01b Data Structures
01b Data Structures
• Vector
• Matrix
• Array
• Data Frame
• List
Vector: 1D Array (either row or column)
Matrix: 2D Array (rows, columns)
Array: 3D or more dimensions (rows, columns, planes)
Data Frames
• A data frame is used for storing data tables. It can be
seen as a collection of column-vectors of equal length.
• Columns:
• Typically called variables or fields
• Must have unique column names
• Each column must have a single Data Type, but the
Data Type of each column can be different.
• Rows:
• Typically called observations or records
• Row names are optional, their index tends to be a
numerical sequence.
Differences Between Computer Science and Math
vs
Differences Between Computer Science and Math
vs
Different ways to create arrays (1/2)
1. With the combine function “c( )”
w <- c(”a”, ”b”, ”c”, “d“, “e“, ”f”)
Data frames:
table <- data.frame(x, w)