Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
For loops and conditions vs. apply and logical subsetting #250
I am of strong opinion that introducing
I would argue that
Again, if you agree, I volunteer to handpick material on
As I said, the loop and branching sections are good, but only as an advanced topic towards the end of the lesson material.
referenced this issue
Nov 25, 2016
I agree that Python and R are different languages with different domains and should be treated accordingly.
My only concern is if we remove
The rationale behind the current lesson order is that
I am more than happy to continue this discussion, as it does set a foundation for our students.
I guess you could use a apply action in stead of a for loop, but that is just a for loop in hiding. Since that does not really make a difference but would introduce new functions . So that doesn't help in the software carpentry lessons.
My argument, then, is that there's no such thing as "beginner programmer in R". There's only "beginner analyst in R". It is very rare instance when for-loops need to be written and those shall be reserved to non-rectangular data types. For everything else R has an awesome functional programming toolbox with base::apply and purrr::map_ families which (although rely on C++ for loops) emphasize the functional aspect of it and hide away the implementation details (which do more harm than good to beginners). This is highly philosophical discussion and I am ready to give in on changing the lesson, if you guys confirm that you taught R with for loops and you tried introducing apply instead and you liked the former better.
R is evolving so fast that I no longer want to stand by
Also, plenty of resources for teaching purrr, not least by Jenny Bryan