swcarpentry/bc — pull request #697 by jdblischak (2014-09-08 15:30:42+00:00)
Title: Updated translation of novice R lesson 03 on loops

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.