Software Carpentry introduction to R for novices using inflammation data.
Python HTML R CSS Makefile JavaScript Other
Latest commit 1c255f7 Feb 7, 2017 @hdashnow hdashnow committed on GitHub Merge pull request #261 from swcarpentry/update-mailmap-and-authors
Updating mailmap and AUTHORS before release
Failed to load latest commit information.
_episodes Merge pull request #228 from keszybz/gh-pages Sep 21, 2016
_episodes_rmd Revert "Activate automatic generation of IDs for terms in reference" Sep 27, 2016
_extras Changing name of instructor notes page as per lesson-example #45 Sep 7, 2016
_includes Merge branch 'gh-pages' of into analytics Sep 27, 2016
_layouts fix search meta tag. Sep 23, 2016
assets Adding support for MATLAB Jul 8, 2016
bin Adding checks for things that commonly go wrong during template conve… Sep 15, 2016
code Trying to fix unclosed style block Jul 5, 2016
data Tidying up files after style merge Jul 5, 2016
fig Merging error-fix changes Jul 10, 2016
files Tidying up files after style merge Jul 5, 2016
.gitignore Ignoring a few more things Jul 18, 2016
.mailmap Fixed, more compact, ordered mailmap (+fixes) Feb 4, 2017
.update-copyright.conf .update-copyright.conf: Configure update-copyright Mar 28, 2015
AUTHORS Force ordering AUTHORS by lastname Feb 6, 2017
CITATION Updating CITATION file Jul 19, 2016 Preparing for June 2016 release Jun 20, 2016 Fixing the contribution guidelines Jul 26, 2016 Preparing for June 2016 release Jun 20, 2016
Makefile Switching to GitHub-defined variables Jul 14, 2016 Spell-check and whitespace removal Jul 11, 2016
_config.yml Switching to page.root for references Sep 5, 2016
favicon-dc.ico Preparing for June 2016 release Jun 20, 2016
favicon-swc.ico Preparing for June 2016 release Jun 20, 2016 Switching to page.root for references Sep 5, 2016 Merge pull request #242 from gvwilson/auto-ids Sep 28, 2016
requirements.txt requirements.txt: Add update-copyright for maintaining contributor list Mar 11, 2015 Switching to page.root for references Sep 5, 2016


Introduction to R for non-programmers using inflammation data.


The goal of this lesson is to teach novice programmers to write modular code to perform a data analysis. R is used to teach these skills because it is a commonly used programming language in many scientific disciplines. However, the emphasis is not on teaching every aspect of R, but instead the focus is on language agnostic principles like automation with loops and encapsulation with functions (see Best Practices for Scientific Computing to learn more). In fact, this lesson is a translation of the Python version, and the lesson is also available in MATLAB.

The example used in this lesson is analyzing a set of 12 data files with inflammation data collected from a trial for a new treatment for arthritis (the data was simulated). Learners are shown how it is better to create a function and apply it to each of the 12 files using a loop instead of using copy-paste to analyze the 12 files individually.


Please see the current list of issues for ideas for contributing to this repository. For making your contribution, we use the GitHub flow, which is nicely explained in the chapter Contributing to a Project in Pro Git by Scott Chacon.

General instructions for making contributions are summarized in When editing topic pages for R lessons, you should change the source R Markdown file (*.Rmd). Only changes to R markdown files and other supporting files (e.g. data files) should be committed to Git.

To view how the changes will look, when viewed in a web browser, you can render the html pages by running make preview from the base of the repository. Generating the html file(s) is required for viewing the online version of the lessons (you can learn more about the design of the build process here). Building the rendered page with the Makefile requires installing some dependencies first. In addition to the dependencies listed in the lesson template documentation, you also need to install the R package knitr.

Once you've made your edits and rendered the corresponding html files, you need to add, commit, and push just the source R Markdown file(s) and any supporting files (e.g. data files). Changes generated by the make preview command should not be committed or included in a pull request. These changes will be taken care off by the lesson maintainer when the PR is merged.

Getting Help

Please see for instructions on formatting, building, and submitting lessons, or run make in this directory for a list of helpful commands.

If you have questions or proposals, please send them to the r-discuss mailing list.