You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library("plyr")
d <- data.frame(x=runif(5), y=runif(5))
aaply(d, 1, mean)
I would have expected the result to be
aaply(as.matrix(d), 1, mean)
just as
apply(d, 1, mean)
i.e. simply treat the data.frame as an array since I use a*ply. Basically it seems to be doing some sort of contingency table with additional computaiton (i.e. the mean) from the data.frame, but I don't understand why it would do this from the documentation.
The text was updated successfully, but these errors were encountered:
I think str(alply(d, 1, mean)) should illustrate the complication - the mean of a data frame is a mean. But something is still going wrong because the output appears to have an extra dimension
I would have expected the result to be
just as
i.e. simply treat the data.frame as an array since I use a*ply. Basically it seems to be doing some sort of contingency table with additional computaiton (i.e. the mean) from the data.frame, but I don't understand why it would do this from the documentation.
The text was updated successfully, but these errors were encountered: