Tag: 冲突库

dplyr:“不应该直接调用n():函数中的错误”

我试图重现dplyr包中的一个例子,但是这个错误信息。 我期待看到每个组合的频率产生一个新的列n。 有人能告诉我我失踪了吗? 我三重检查,包被加载。 感谢您的帮助,一如既往。 library(dplyr) # summarise peels off a single layer of grouping by_vs_am <- group_by(mtcars, vs, am) by_vs <- summarise(by_vs_am, n = n()) #Error in n() : This function should not be called directly