这可能非常简单,但是,我有一个短语向量,其中一些重复,其中一些不重复,我想要一个独特短语的列表,按最常出现的排序。
例如
vec <- c("hello","hi","hi","greetings","good day", "hi", "hello", "good day","good morning","hello","good day")
sort(unique(vec))
[1] "good day" "good morning" "greetings" "hello" "hi"
我希望首先是“hi”,然后是“hello”,然后是“good day”等......