Error in aggregate.data.frame : arguments must have same length

前端 未结 5 1527
我寻月下人不归
我寻月下人不归 2021-02-06 02:09

I keep getting this error and I\'m not quite sure what it means. All of my variable names are consistent and there are no typos. Am I missing something here?

The code

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 03:07

    Using data.frame as by argument works for me try this:

    datNewagg <- aggregate (dataNew, by = dataNew[c('x', 'y', 'z', 'a', 'ab')],                                                             FUN = mean)
    

    I mean don't give the by argument, just the name of the arguments, give a data.frame with columns as these arguments

提交回复
热议问题