Frequency Tables
table counts values and prop.table gives proportions.
Example
x <- c("a", "b", "a", "c", "a")
t <- table(x)
print(t)
print(round(prop.table(t), 2))
print(names(t)[t == max(t)])
print(table(c(1, 1, 2), c("x", "y", "y")))Exercise
Proportions.
.table(t)Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.