swcarpentry/bc — pull request #701 by jdblischak (2014-09-09 13:44:53+00:00)
Title: Translation of lesson on writing command-line programs from Python to R

I have translated the Python lesson on [Command-Line Programs][py] to R. It is ready for review. To properly compare these lessons, you'll need to locally build the R lesson, which you can accomplish by running the code below:

[py]: http://software-carpentry.org/v5/novice/python/06-cmdline.html

```
# 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 06-cmdline
# build site locally
make site
```
Then compare the rendered files _site/novice/r/06-cmdline.html and _site/novice/python/06-cmdline.html.

The main translations involve:

+ Use `commandArgs(trailingOnly = TRUE)` to replace `sys.argv` for reading in command-line arguments
+ Use `file("stdin")` to replace `sys.stdin` for reading from standard input
+ Use `cat(vec, sep = "\n")` to replace `for m in values: print m` for writing to standard output