Working on Variables

This section focuses on functions that help create, add, modify and transform variables.

Credits: icons adapted from Rstudio cheat sheet Data Transformation with dplyr : : CHEAT SHEET – CC BY SA RStudio


Working with large data sets may be time-consuming or demanding in terms of computer resources due to high number of variables combined with high numbers of observations. Moreover, displaying a table/data frame with many variables in R/Rstudio isn’t very practical and you may soon want to reduce the data set […]

Extract Variables


dplyr and tidyverse (a larger package which includes dplyr) give the possibility to add columns (and thus variables) to an existing data frame. You may either add a new column from new data (usually based on the content of a vector, the content of another table or data frame, or […]

Make New Variables


dplyr and tidyverse (a larger package which includes dplyr) give the possibility to add columns (and thus variables) to an existing data frame. You may either add a new column from new data (usually based on the content of a vector, the content of another table or data frame, or […]

Compute Variables



A couple of variants of the functions mutate() and transmute() which are described here allow for modifying the content of a selection of variable(s). This means that, instead of adding new columns with the results of a given transformation/operation, the contents of the original variables are replaced by these results. […]

Transform Variables