https://www.rstudio.com/resources/cheatsheets/ - A lot of Cheat Sheets

Data.Frame

library(tidyverse)

Import

Select

df <- data.frame(n = c(4 ,5, 6, 7),b = c(8, 9, 10, 11),c = c(12, 13, 14, 15))

1531977748004

Example Info Description
df[1,] # 1531977902695 1st row
df[-1,] # 1531977939797 Everything except 1st row
df[1:3,] # 1531977980416 From 1st to 3rd row
df[1] # 1531978022669 1st column
df[1:2] # 1531978055998 From 1st to 2nd column
df[c("n","c")] # 1531978113830 Column ‘n’and ‘c’
df[1:3,c("n","c")] # 1531978152861 Combine column and row select.
df$n # 1531978194990 Column “n”. Result is numeric vector.