我有一个几年前使用dapr构建的函数。现在由于冲突,我想更新为dapr。dapr::ddply(dataset,by,function(x)与dapr的等价形式是什么?请参见下面:
#Works
intervals <- function(dataset, by, model) {
# code
ddply(dataset, by, function(x) {
#More code
}
}
#Does not work
intervals <- function(dataset, by, model) {
# code
#How to call function(x) with dplyr? I am getting an error here...
dataset %>% group_by(by) %>% function(x) {
#More code
}
}
Error in dataset %>% group_by(by) %>% function(x) { :
invalid formal argument list for "function"
字符串
1条答案
按热度按时间jgovgodb1#
字符串
或者更简洁地说
型
我创建了
rn
,然后用它创建了arrange
,这只是为了更简单的比较。