Quotes help make search much faster. Example: "Practice Makes Perfect"

Wednesday, September 4, 2019

Codecademy Learn R Filtering Rows with Logic I 9/12


#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}
# filter rows one condition
rock_groups <- artists %>% filter(genre == 'Rock')
rock_groups
```

```{r}
# filter rows multiple conditions
popular_rock_groups <- artists %>% filter(genre == 'Rock', spotify_monthly_listeners > 20000000)
popular_rock_groups
```

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts