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
datNewagg <- aggregate (dataNew, by = list('x', 'y', 'z', 'a', 'ab'),
FUN = mean)
Produces the error
Error in aggregate.data.frame(datNew, by = list("x", "y", :
arguments must have same length
aggregate
call, as it mat be incorrectly specified. ty – user20650aggregate(mtcars, list("am"), mean)
. But if you specify it likeaggregate(mtcars, list(mtcars$am), mean)
oraggregate(. ~ am , mean, data=mtcars)
everything is okay – user20650datNewagg <- aggregate (dataNew, by = list('x', 'y', 'z', 'a', 'ab'), FUN = mean)
– RHatesMedatNewagg <- aggregate (. ~ x + y + z + a + ab), FUN = mean, data=dataNew)
ordatNewagg <- with(dataNew, aggregate (dataNew, by = list(x, y, z, a, ab), FUN = mean))
– user20650