Length = c(0.29, 0.25, NA, 0.40, 0.50, 0.57, 0.62, 0.88, 0.99, 0.90)
Rating = factor(ordered=TRUE, levels=c("Low", "Medium", "High"),
x = rep(c("Low", "Medium", "High"), c(3,3,4)))
Color = factor(rep(c("Red", "Green", "Blue"), c(4,4,2)))
Flag = factor(rep(c(TRUE, FALSE, TRUE), c(5,4,1)))
Answer = factor(rep(c("Yes", "No", "Yes"), c(4,3,3)), levels=c("Yes", "No"))
Location = factor(rep(c("Home", "Away", "Other"), c(2,4,4)))
Distance = factor(ordered=TRUE, levels=c("Low", "Medium", "High"),
x = rep(c("Low", "Medium", "High"), c(5,2,3)))
Start = seq(as.Date("2024-01-01"), by = "month", length.out = 10)
Data = data.frame(Length, Rating, Color, Flag, Answer, Location, Distance, Start)
correlation(Data)
Run the code above in your browser using DataLab