This PR continues the translation of the novice Python lessons that began back in March. See PR #639 for the first lesson and also directions on how to view these changes locally (the GitHub rendered version does not have the images loaded).
For context, here are links to the novice Python lesson being translated (rendered, source).
Here are some of the main decisions I made that expect to be discussed:
Since string processing is more difficult in R compared to Python, I switched the exercises from indexing a string to indexing a vector.
I use the term stack frame in preference to environment. My thinking is that using the general terminology will help them understand any programming language they come across, and that they can learn more about the details of R and environments from other sources if they choose to become more advanced R programmers. For example, we have material on environments and scoping rules for our intermediate R bootcamps.
Instead of performing mathematical operations, e.g. mean, sd, on an entire array of data, which requires converting the data frame to a matrix, I changed the lesson to always perform these sorts of operations on vectors. This removes the awkward discussion of how sometimes we use a data frame and sometimes a matrix. If others like this, I will edit the first lesson to also avoid needing a matrix.
I changed the indenting of function bodies from 4 spaces to 2. While arbitrary, this change is in agreement with the Google R style guide, Hadley's style guide, and the default setting in RStudio.
Please let me know what you think of the translations! Thanks!
Also, please make sure to focus on 02-func-R.Rmd on this thread. This PR also includes some commits from PR #639 because I moved some data files around, which affected all the downstream lessons.
This PR continues the translation of the novice Python lessons that began back in March. See PR #639 for the first lesson and also directions on how to view these changes locally (the GitHub rendered version does not have the images loaded).
For context, here are links to the novice Python lesson being translated (rendered, source).
Here are some of the main decisions I made that expect to be discussed:
mean
,sd
, on an entire array of data, which requires converting the data frame to a matrix, I changed the lesson to always perform these sorts of operations on vectors. This removes the awkward discussion of how sometimes we use a data frame and sometimes a matrix. If others like this, I will edit the first lesson to also avoid needing a matrix.Please let me know what you think of the translations! Thanks!