这是我的代码
page<-read_html("https://stat.ethz.ch/pipermail/r-help/2016-March/date.html")
author<-html_nodes(page, "li i") %>% html_text() %>% trimws()
table(author)
我得到了表格,但我正在尝试计算前十位最常出现的作者。最好的方法是什么,最好是使用表函数?谢谢
最佳答案
我们可以排序
并使用head
获取前10个元素
head(sort(table(author), decreasing = TRUE), 10)
关于html - 计算 R 中前 10 名最常见作者的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58740190/