r - Error: $ operator is invalid for atomic vectors -
i trying make boxcox transformation of variable (i.e. sqrt.cr) lambda value -2 2. on running below r code gives error of invalid atomic vectors. later on checking earlier posts saw few suggestions transform matrix data frame. though error continued show up. know figure out error ?
r code.
matrix data frame conversion
drivers.data<-as.data.frame(drivers)
boxcox transfrom.
drivers$box_cr<-boxcox(drivers.data$sqrt.cr,lambda=seq(-2,2))
the input boxcox must output of lm or aov call, not vector of numbers yours appears be. see ?boxcox
.
boxcox(object, ...)
arguments:
object: formula or fitted model object. ‘lm’ , ‘aov’ objects handled.
Comments
Post a Comment