Can someone tell me why example 1 is not working but example 2 works? (I pipe a data set into mean function, but want only one variable, but if I do the selection first and pipe the result there is no problem)
iris %>% mean(.$Sepal.Length)
NA
Warning message:
In mean.default(., .$Sepal.Length) :
argument is not numeric or logical: returning NA
iris %>% .$Sepal.Length %>% mean()
5.843333