[R] Difference between SPlus & R question

Marc Feldesman feldesmanm at pdx.edu
Fri Jun 23 06:12:58 CEST 2000


In S-Plus, I do the following:

v1<-rnorm(50)
v2<-rnorm(50)
v3<-"gorilla"
v4<-cbind(v1, v2)
v5<-data.frame(v4, v5)

v5 is a dataframe with 50 rows and 3 columns.  The third column has 
"gorilla" replicated for all 50 rows - the behavior I desire.  (It also 
works if I simply do:

v5<-data.frame(v1, v2, v3)

leaving out the cbind() step altogether.


If I try the same thing in R, it rejects v5, reporting an error that v4 has 
50 rows while v3 has 1 row.

What is the proper way to achieve the same result in R?

Thanks,

===================================================
Dr. Marc R. Feldesman
Professor and Chair
Anthropology Department
Portland State University
Portland, Oregon 97207

email: feldesmanm at pdx.edu
http://odin.pdx.edu/~h1mf

Powered by Inspirochoerus

"Indecision may or may not be my problem"
===================================================

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list