swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

Updated translation of novice R lesson 03 on loops #697

Closed jdblischak closed 9 years ago

jdblischak commented 9 years ago

This is ready for review. Unfortunately the Markdown file is not properly rendered by GitHub because of the html we purposely add for proper display from our website. To compare both the rendered Python and R versions of the lessons, follow the instructions below:

# clone bc repo
git clone git@github.com:swcarpentry/bc.git
# create and switch to new branch
git checkout -b review-pr
# add remote
git remote add jdb git@github.com:jdblischak/bc.git
# pull changes from my branch
git pull jdb 03-loops
# build site locally
make site

Then compare the rendered files _site/novice/r/03-loops-R.html and _site/novice/python/03-loop.html.

Quick summary of the major changes

I used the easier syntax for (for item in collection) instead of for (i in seq_along(collection)) because it is easier for novices that are first learning how to write a for loop and also because it is in line with the novice Python lesson. The Python equivalent to R's seq_along(collection) would be range(len(collection)).

I removed many topics that are more specific to the Python lesson. For example, I see no natural way to discuss mutable vs immutable types in a novice R lesson. Also, there is no need to introduce the list class in this lesson because R is vectorized.

@gavinsimpson added an in-depth explanation of loops in R that nicely explains many of the misconceptions that many new R users have. I felt that this discussion was too advanced for novices that just wrote their first for loops. Thus I separated it into a separate supplementary file and linked to it from the main lesson. This way online learners that have more experience programming in R can benefit from this explanation.

BernhardKonrad commented 9 years ago

Maybe I'm tripping, but are the Rmd and html version in sync? https://jdblischak.github.io/bc/novice/r/03-loops-R.html

jdblischak commented 9 years ago

Maybe I'm tripping, but are the Rmd and html version in sync? https://jdblischak.github.io/bc/novice/r/03-loops-R.html

No. You're right. I merged my local branches to the gh-pages to help everyone see the final rendered form. Unfortunately the local branches were not up-to-date. I am fixing that for this lesson and ensuring the problem doesn't occur for the other lessons as well. So sorry about that!

jdblischak commented 9 years ago

Alright. They are in sync now. That could have been a disaster. Luckily, this was the only lesson that was out-of-date. Thanks again for catching that!

BernhardKonrad commented 9 years ago

I think this is an excellent translation of the python lecture, good job!

jdblischak commented 9 years ago

On Tue, Sep 9, 2014 at 10:44 PM, Bernhard Konrad notifications@github.com wrote:

I think this is an excellent translation of the python lecture, good job!

Thanks for the review, Bernhard! I've incorporated your suggestions.