studentID <- c(101, 102, 103, 104, 105) firstName <- c(“Alice”, “Bob”, “Charlie”, “Diana”, “Ethan”) lastName <- c(“Smith”, “Brown”, “Taylor”, “Johnson”, “Lee”) passFail <- c(TRUE, FALSE, TRUE, TRUE, FALSE)
print(studentID) str(studentID)
print(firstName) str(firstName)
print(lastName) str(lastName)
print(passFail) str(passFail)
studentTable <- data.frame(studentID, firstName, lastName, passFail)
print(studentTable) str(studentTable)
matrix1 <- matrix(1:20, nrow = 4, ncol = 5) matrix2 <- matrix(letters[1:20], nrow = 4, ncol = 5)
print(matrix1) str(matrix1)
print(matrix2) str(matrix2)
array1 <- array(1:27, dim = c(3, 3, 3)) array2 <- array(letters[1:27], dim = c(3, 3, 3))
print(array1) str(array1)
print(array2) str(array2)
vector1 <- c(10, 20, 30) vector2 <- c(“X”, “Y”, “Z”, “W”) vector3 <- c(TRUE, FALSE) vector4 <- c(5.5, 6.7, 8.9)
myList <- list(vector1, vector2, vector3, vector4)
print(myList) str(myList)
nestedList <- list(myList)
print(nestedList)