Hello, All!
I would love help with the dataframe I am trying to build. I need to create a dataframe that has 500 rows and 3 columns. Each column is a "Day" (defined below) and each row is an individual entry. The values must be random and CANNOT repeat across the rows, but may repeat within the columns. I have been able to build this in piece meal below. Is there a way to do this in a clean, fast way? THANK YOU FOR ANY HELP.
Days <- c("Monday Morning", "Monday Afternoon", "Monday Evening", "Tuesday Morning", "Tuesday Afternoon", "Tuesday Evening", "Wednesday Morning", "Wednesday Afternoon", "Wednesday Evening", "Thursday Morning", "Thursday Afternoon", "Thursday Evening", "Friday Morning", "Friday Afternoon", "Friday Evening", "Saturday Morning", "Saturday Afternoon", "Sunday")
A <- sample(Days, 3, replace = F)
B <- as.data.frame(t(A))
colnames(B) <- c("A","B","C")
C <- sample(Days, 3, replace = F)
D <- as.data.frame(t(C))
colnames(D) <- c("A","B","C")
E <- sample(Days, 3, replace = F)
F <- as.data.frame(t(E))
colnames(F) <- c("A","B","C")
rbind(B,D,F)
View(rbind(B,D,F))