Skip to content

Commit

Permalink
#13 Add comprehension testing questions
Browse files Browse the repository at this point in the history
  • Loading branch information
ymkng committed Oct 27, 2020
1 parent cae26a9 commit 8307bae
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ dat <- mutate(raw_dat, Depth = as.factor(Depth),
Cruise = as.factor(Cruise))
```

```{r factors, echo=FALSE}
question("Which of these variables could potentially be represented as categorical vectors? (select ALL that apply)",
answer("Colour of flower petals of 9 different plants", correct = TRUE),
answer("Oxygen concentration in uM"),
answer("Ammonium concentration in nM"),
answer("Number of days it takes a plant to sprout", correct = TRUE),
incorrect = "Incorrect. Hint: Categorical variables usually take on a fixed set of values")
```

Using the `%in%` binary operator we can filter for groups of values. Subset data to 3 depths in 7 cruises (i.e. specimens) in February:
```{r}
dat <- filter(dat, Depth %in% c(10, 100, 200),
Expand Down

0 comments on commit 8307bae

Please sign in to comment.