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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -