Data type in the datasheet
words: “California” categorical data: a / b / c logical: TRUE, FALSE number: 10 missing data: NA
Hot key
run one chunk in the scripts:
ctrl + Enter
run all chunks in the scripts:
ctrl + Enter + Shift
Data type in R
vector
vector <- c("Ada","Emily","Jack")
if you combine different data types into one vector, you will get vector consist of string
vector <- c(TRUE,"Ada",10)
factor
groups <- factor(c("Treatment1","Treatment2","Control","Treatment2"))
# factor group value into groups, set levels in alphabetical order