Skip to content
Prev 25508 / 398502 Next

taking rows from a data frame

Lei Jiang wrote:
Perhaps the following would do the trick.

df$corv <- apply(df,1,function(x) cor(x,myv,use="complete.obs"))

-Bill


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._