r - How to convet an S4 class objects slots into vectors or matrix? -
i have s4 class object rocr package. has several slots containing data related among each other (i.e. "x.values", "y.values", , "alpha.values").
i merge them in matrix accessing slots make calculations (youden indices, etc.)
i've tried things (according limited knowledge of r)
test<-cbind(perf@x.values,perf@y.values,perf@alpha.values)
and other formulas such changing class of object directly...
but worked.
any welcomed
thanks
if know slot names (use getclass
if don't), can pull them out @
operator. don't know rocr assuming have slot names right, can do
x <- perf@x.values y <- perf@y.values <- perf@alpha.values
and examine them other r object. cbind isn't working because dimensions of objects don't match.
Comments
Post a Comment