Aug 12, 2024
5 + 6 = 11
.<-
to assign values.
a <- 5
, b <- 6
.a + b
will result in 11
.sum(a, b)
results in 11
.c()
to concatenate values.
name <- c('Greg', 'Jill')
.friends <- data.frame(name, age, gender)
.friends$name
.[rows, columns]
to subset data.
friends[1, ]
gives the first row.friends[friends$age < 50, 1:2]
.install.packages('tidyverse')
.library(tidyverse)
.%>%
simplifies chaining commands.
friends %>% select(name, age) %>% filter(age < 50)
.