-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error in tapply() example #39
Comments
I planned to write almost exactly the same thing. using(airquality, mean(Ozone, na.rm = TRUE), split.by = Month)
mean
5 23.615
6 29.444
7 59.115
8 59.962
9 31.448 Additionally, instead of: mtcars$gear_char <-
ifelse(mtcars$gear == 3,
"three",
ifelse(mtcars$gear == 4,
"four",
"five")
) this is arguably also more intuitive: mtcars$gear_char <- recode(mtcars$gear, "3 = three; 4 = four; 5 = five") |
I think the object was to do this without loading non-base-R packages. If that requirement is relaxed, there's also the |
Indeed. |
It's my impression that 'base R' typically refers not just to the base package but to the R packages loaded by default at start-up or the packages in the standard R distribution. |
You are correct, that should be the interpretation of the 'base R'. |
Great discussions, and again, sorry I'm late to it. I just today looked at the Issues posts. Once again, though, my overriding goal is to make things easy for beginners. That excludes using other packages, for instance. As to tapply(), I'm not offering it as a panacea, just something I think is easier for noncoders to learn and use. If tapply() doesn't quite work, I recommend that beginners--the horror!--write a loop. |
Dear Norm,
I've enjoyed the various versions of your tidyverse critique and largely agree with it. I noticed the following error in the current version, which I don't believe has been flagged before:
Your
tapply()
example doesn't handleNA
s consistently.The following would be consistent with the tidyverse solution and
aggregate()
:The text was updated successfully, but these errors were encountered: