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
adply() does not seem to work consistently. It does not work with some functions (i.e., mean(), median()) but does work with other functions (sum(), sd()) when applying to the same df of numeric values.
df = tibble(x = 1:10, y = 1:10)
plyr::adply(df, 1, mean)
x y V1
1 1 1 NA
2 2 2 NA
3 3 3 NA
4 4 4 NA
5 5 5 NA
6 6 6 NA
7 7 7 NA
8 8 8 NA
9 9 9 NA
10 10 10 NA
Warning messages:
1: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
2: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
3: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
4: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
5: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
6: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
7: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
8: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
9: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
10: In mean.default(piece, ...) :
argument is not numeric or logical: returning NA
plyr::adply(df, 1, median)
Error in median.default(piece, ...) : need numeric data
adply() does not seem to work consistently. It does not work with some functions (i.e., mean(), median()) but does work with other functions (sum(), sd()) when applying to the same df of numeric values.
But works with sum():
or sd():
The text was updated successfully, but these errors were encountered: