penguins %>%
select(bill_length_mm) %>%
filter(!is.na(bill_length_mm)) %>%
mean(as.numeric(bill_length_mm), na.rm=TRUE)
Error message: argument is not numeric or logical: returning NA[1] NA
Examining the dataset after filtering shows numeric data with no NAs.
Why am I getting this error? Shouldn't line two or line three of the code remove all NAs?
Thank you.