set.seed(5) # 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: Janice and Kennedy"
[1] "Team 2: Hayden and Melissa"
[1] "Team 3: Maggie and Yuanzhi"