P1 - Data Structures Flashcards
1
Q
Array function
A
- A 3D structure that takes one data type
- array(df, dim = c(1,1,1))
2
Q
Matrix function
A
- 2D data structure that only takes one data type
- matrix(df, nrow = x, ncol = y, byrow = T/F, dimnames = list(c()))
3
Q
Factor function
A
- Converts characters to factor (categorical)
4
Q
Data frame function
A
- 2D structure that uses many data types
- data.frame( variable name = c(“help”, “hello”), number variable = c(1,2)…)
5
Q
Use the summarise function and remove NA values.
A
- summarise(df, NEW column name = mean(column, na.rm = TRUE))