seankross / mario

🍄 But our princess is in another castle!
Other
21 stars 1 forks source link

create some tests that result in empty data frames #14

Closed pgbovine closed 2 years ago

pgbovine commented 2 years ago

(so that we can test edge cases)

pgbovine commented 2 years ago

e.g., filtering by conditions that result in 0 matching rows, or selecting to match 0 columns, etc.

pgbovine commented 2 years ago

Examples from my notes (these all seem to work for now). include library(dplyr) for everything:

# results in an empty table
Formaldehyde %>% filter(optden > 1.5)

... then select from an empty table:

Formaldehyde %>% filter(optden > 1.5) %>% select(carb)

... then also mutate it:

Formaldehyde %>% filter(optden > 1.5) %>% select(carb) %>% mutate(carb2 = carb*2, carb3 = "hello")