Re: [R] by function error

2017-04-20 Thread PIKAL Petr
chr "by" You maybe should consult ?aggregate. Cheers. Petr -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of ??? Sent: Thursday, April 20, 2017 2:17 AM To: r-help Subject: [R] by function error hi, I practice R programing by the step in &

[R] by function error

2017-04-20 Thread ??????
hi, I practice R programing by the step in <>; when i test by function, i get error like these; call for help! dstats <- function(x){c(mean=mean(x), sd=sd(x))} > by(mtcars[,c('mpg', 'hp')], mtcars$am, dstats) Show Traceback Rerun with Debug Error in is.data.frame(x) : (list) object canno