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

前端 未结 5 1622
我寻月下人不归
我寻月下人不归 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条回答
  •  南旧
    南旧 (楼主)
    2021-02-06 02:53

    Check class(dataNew). If it's not a data.frame, this dataNew <- data.frame(dataNew) before aggregation should solve the error or

    datNewagg <- aggregate (data.frame(dataNew), by = list('x', 'y', 'z', 'a', 'ab'), 
                                                             FUN = mean)
    

提交回复
热议问题