Error in drop_na(.) : could not find function "drop_na"

Hello everyone,

I am following an online training on R Studio; recently the trainer wrote this code to perform a task
penguins %>% group_by(island) %>% drop_na() %>% summarise(mean_bill_length_mm = mean(bill_length_mm))
and it worked with her; however, when I wrote the same, this message appeared
Error in drop_na(.) : could not find function "drop_na"

Does someone know how to solve the error?

Thank you in advance for your help!

drop_na() is a function in the tidyr package. Did you load that package using library(tidyr)? You can also load the core tidyverse packages, including tidyr, using library(tidyverse).

1 Like