# Task 3
studentID <- c(101, 102, 103, 104, 105)
firstName <- c("Maya", "Jordan", "Ava", "Noah", "Nia")
lastName <- c("Brown", "Jones", "Smith", "Davis", "Wilson")
passFail <- c(TRUE, TRUE, FALSE, TRUE, FALSE)

print(studentID)
print(typeof(studentID))
str(studentID)

print(firstName)
print(typeof(firstName))
str(firstName)

print(lastName)
print(typeof(lastName))
str(lastName)

print(passFail)
print(typeof(passFail))
str(passFail)

# Task 4
studentTable <- data.frame(studentID, firstName, lastName, passFail)
print(studentTable)
str(studentTable)

# Task 5
numberMatrix <- matrix(1:20, nrow = 5, ncol = 4)
print(numberMatrix)
print(typeof(numberMatrix))
str(numberMatrix)

wordMatrix <- matrix(
  c("red", "blue", "green", "pink", "yellow",
    "dog", "cat", "bird", "fish", "horse",
    "school", "class", "book", "notes", "desk",
    "music", "dance", "cheer", "game", "coding"),
  nrow = 5, ncol = 4
)
print(wordMatrix)
print(typeof(wordMatrix))
str(wordMatrix)

# Task 6
numberArray <- array(1:24, dim = c(2, 4, 3))
print(numberArray)
print(typeof(numberArray))
str(numberArray)

logicalArray <- array(rep(c(TRUE, FALSE), 12), dim = c(2, 4, 3))
print(logicalArray)
print(typeof(logicalArray))
str(logicalArray)

# Task 7
scores <- c(80, 90, 85)
names <- c("Maya", "Jordan", "Ava", "Noah")
passed <- c(TRUE, FALSE, TRUE, TRUE, FALSE)
ages <- c(20, 21, 22, 19, 23, 24)
studentList <- list(scores, names, passed, ages)
print(studentList)
str(studentList)

# Task 8
nestedList <- list(studentList)
print(nestedList)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: