You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I actually think that, while mapping as a topic is difficult, the implementation (at least in R) is relatively straight forward using purrr. Plus by at least showing it, the learners can see that this tool exists. And then they won't be tempted to using for loops (not good in R). Originally posted by @lwjohnst86 in https://github.com/merely-useful/merely-useful.github.io/pull/63/files
Using "mapping" (aka functional programming) in R is fairly common, given that R strength is not in iteration but in vectorization. I think some section on it would be useful mainly as a deterred to using loops and to show that there are saner ways of iterating rather than using the *apply family of R functions. I don't know what the equivalent is for Python.
Should we also include material on map in the novice R material?
The text was updated successfully, but these errors were encountered:
I like this idea! Being able to solve a problem on one object and then easily apply it to many is one of the huge powers of coding for data analysis that I'd like novices to be exposed to.
A couple of questions:
How much does this necessitate a detour into understanding lists? Lists are a fundamental data type for people to master in R, so I see the value in covering them, but I've also been guilty of ending up spending so much time of this part, that the actual iteration part gets swamped.
Do we go anywhere near list columns? I use them all the time, in fact most of my map() uses are inside tibbles, but if you are still mastering mutate() adding map() to the mix can be confusing.
At some point we might talk about element-wise operations, and that many R functions work this way be default, i.e. vectorization. We could then introduce map() as a way of handling functions that don't work this way.
Using "mapping" (aka functional programming) in R is fairly common, given that R strength is not in iteration but in vectorization. I think some section on it would be useful mainly as a deterred to using loops and to show that there are saner ways of iterating rather than using the
*apply
family of R functions. I don't know what the equivalent is for Python.Should we also include material on
map
in the novice R material?The text was updated successfully, but these errors were encountered: