# NOT RUN {
r_sample_ordered(100, name = "Var")
lvls <- c("Strongly Agree", "Agree", "Neutral", "Disagree", "Strongly Disagree")
table(r_sample_ordered(x = lvls, n=1000))
(out <- r_sample_ordered(x = c("Black", "Grey", "White"),
prob = c(.5, .2, .3), n = 100))
slices <- c(table(out))
pie(slices, main="Pie Chart of Colors", col = tolower(names(slices)))
# }
Run the code above in your browser using DataLab