How to get a list sorted by frequency, in R

I am trying to get a list sorted by frequency from a data frame.

data <- read.csv('ads.csv') write.table(summary(data$Publication.Name), quote = FALSE, sep = ",") 

I'm not sure if summary () is really the best way to get frequencies, I'm open to a better way. How can I sort this by frequency first?

+6
source share
1 answer

I would use table , for example

 yourdata <- sample(1:10,100,replace=T) x <- sort(table(yourdata),decreasing=T) write.csv(x,"mytable.csv",quote=F) 
+12
source

Source: https://habr.com/ru/post/957186/


All Articles