Try doing somthing like this :

#your vector1 & 2
vect1 <- 2:5
vect2 <- c(3,1,6,4)

# put both vectors in data.frame
combVect <- data.frame(vect1=vect1, vect2=vect2)

Note :
1) I suggest to avoid naming objects with names of already existing functions like "rm" 2) In R it is usually helpful to see your data as vetors and this way you can avoid for for() loop 3) Have also a look at the R-Wiki ( http://wiki.r-project.org/rwiki/doku.php ) and the other documents on www.r-project.org : There are some very good tutorials about the different types of data-structures and objects in R (and their use) !!!

Wolfgang

Tammy Ma a écrit :
HI, R user,

I generate the vectors with the same length. I want to put each vector into 
each column of data frame. Why it doesnt work`?

rm<-data.frame()

for(a in 1:6){
 rm[,a]<-getmeasure(p1,a,speech)
}

thanks a lot

Tammy

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Wolfgang Raffelsberger, PhD
Laboratoire de BioInformatique et Génomique Intégratives
CNRS UMR7104, IGBMC, 1 rue Laurent Fries, 67404 Illkirch Strasbourg, France
Tel (+33) 388 65 3300         Fax (+33) 388 65 3276
wolfgang.raffelsberger (a t) igbmc.fr

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to