#Sample Solution
---
title: "Introduction to Data Frames in R"
output: html_notebook
---
```{r message=FALSE, warning=FALSE}
# load libraries
library(readr)
library(dplyr)
```
```{r message=FALSE}
# load data frame
artists <- read_csv('artists.csv')
```
```{r}
# select all columns except one
no_albums <- artists %>% select(-albums)
no_albums
```
```{r}
# select all columns except a set
df_cols_removed <- artists %>% select(-genre,-spotify_monthly_listeners,-year_founded)
df_cols_removed
```
No comments:
Post a Comment