| Quick Reference R CheatsheetBase R on one page — vectors, missing values, data frames, apply, and the traps around 1:length, sample, and drop. 10 sections 10 tables 14 code snippets Run a scriptA file A vector The names
This page is base R. dplyr, ggplot2, and the rest of the tidyverse are left out. VectorsThe first value Every position Index rules
Missing valuesFind the gaps Three kinds of empty
SubsettingPick and drop How a subset is chosen
ConditionsOne value for if Which operator
FunctionsA total Call rules
ListsOne element, unwrapped List rules
Data framesRows that match Column rules
Apply and the pipeA fixed result type The base pipe Which tool
Interview trapsTraps worth memorising
Positions of any length A shuffle that keeps length 1 How to use this page: build a vector with |