set.seed(22) # set the seed for the random number generator
teams <- sample(
c("Hayden", "Janice", "Kennedy", "Maggie", "Melissa", "Yuanzhi"), # students from which to choose
size = 6 # number of students to choose
)
print(paste0("Team 1: ", teams[1], " and ", teams[2]))
print(paste0("Team 2: ", teams[3], " and ", teams[4]))
print(paste0("Team 3: ", teams[5], " and ", teams[6]))
[1] "Team 1: Yuanzhi and Hayden"
[1] "Team 2: Maggie and Janice"
[1] "Team 3: Kennedy and Melissa"