Question:

Write the R programming code for an array of words so that the output is displayed in decreasing frequency order.

Answer:

R Programming Code to display output in decreasing frequency order -

tt <- sort(table(c("a", "b", "a", "a", "b", "c", "a1", "a1", "a1")), dec=T)
depth <- 3
tt[1:depth]

Output -

1) a a1  b
2) 3  3  2

Keywords:

© 2017 QuizBucket.org