[R Course] R nanocourse 3. Data Wrangling

R Courses R Nanocourses

Learn the basics of data manipulation by transforming datasets in order to represent and interpret results.

Thierry Warin https://warin.ca/aboutme.html (HEC Montréal and CIRANO (Canada))https://www.hec.ca/en/profs/thierry.warin.html


What makes R a compiling programming language is its facility to wrangle data on the fly. In this session, you will learn the basics of data manipulation. Based on the knowledge acquired in the previous sessions, you will transform complex datasets in order to represent and interpret results. We will use the United Nations Industrial Development Organization (UNIDO) dataset to illustrate this session.


At the end of the lecture, you should be able to:

  1. know what a dataframe is;
  2. add a column to an existing dataframe;
  3. subset your dataframe based on a variable;
  4. sort your dataframe;
  5. transform your dataframe from long to wide form;
  6. merge two datasets;
  7. visualize your results.

You will go from a database of 655’350 points to a graphic made of 6 observations.

Keywords: data wrangling; RStudio; reproducible research



For attribution, please cite this work as

Warin (2019, May 23). www.warin.ca: [R Course] R nanocourse 3. Data Wrangling. Retrieved from https://warin.ca/posts/rcourse-rnanocourse3/

BibTeX citation

  author = {Warin, Thierry},
  title = {www.warin.ca: [R Course] R nanocourse 3. Data Wrangling},
  url = {https://warin.ca/posts/rcourse-rnanocourse3/},
  year = {2019}