Skip to content

Commit

Permalink
reordering elements in question for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
carriewright11 committed Dec 5, 2024
1 parent 891bfc2 commit 2cefbe2
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,24 @@ head(select(ces_sub, Asthma))
Subset the rows of `ces_sub` that have **more** than 100 for `Asthma` - how many rows are there? Use `filter()`.

```{r 2.4response}
ces_sub <- filter(ces_sub, Asthma > 100)
nrow(ces_sub)
nrow(filter(ces_sub, Asthma > 100))
```

### 2.5

Subset the rows of `ces_sub` that have a `Traffic` value **less** than 500 and an `Asthma` value **more** than 100 - how many are there?
Subset the rows of `ces_sub` that have an `Asthma` value **more** than 100 and a `Traffic` value **less** than 500 and — how many are there?


```{r 2.5response}
filter(ces_sub, Traffic < 500 & Asthma > 100) # all of these options work
nrow(filter(ces_sub, Traffic < 500 & Asthma > 100))
nrow(filter(ces_sub, Traffic < 500, Asthma > 100))
filter(ces_sub, Asthma > 100 & Traffic < 500) # all of these options work
nrow(filter(ces_sub, Asthma > 100 & Traffic < 500))
nrow(filter(ces_sub, Asthma > 100, Traffic < 500))
```

### 2.6

Subset the rows of `ces_sub` that have a `Traffic` value **less than or equal to** 500 and an `Asthma` value **more** than 100 - how many are there?
Subset the rows of `ces_sub` that have an `Asthma` value **more** than 100 and a `Traffic` value **less than or equal to** 500 — how many are there?

```{r 2.6response}
filter(ces_sub, Traffic <= 500 & Asthma > 100) # all of these options work
Expand Down

0 comments on commit 2cefbe2

Please sign in to comment.