[R] How to add some of data in the first place dataset

2005-04-27 Thread Muhammad Subianto
Dear R-help, First I apologize if my question is quite simple. I need add some of data in the first place my dataset, how can I do that. I have tried with rbind, but I did not succes. 0.1 3.6 0.4 0.9 rose 4.1 4.0 1.2 1.2 rose 4.4

[R] How to add some of data in the first place dataset

2005-04-27 Thread Tyler Smith
Try this: x- matrix(1:12, nrow = 4, byrow = T) y - matrix (13:24, nrow=4, by.row=T) To add the rows of y before the rows of x: rbind(y,x) -- Tyler Smith __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] How to add some of data in the first place dataset

2005-04-27 Thread Henric Nilsson
Muhammad Subianto said the following on 2005-04-27 15:48: Dear R-help, First I apologize if my question is quite simple. I need add some of data in the first place my dataset, how can I do that. I have tried with rbind, but I did not succes. Can you send a reproducible example where rbind

Re: [R] How to add some of data in the first place dataset

2005-04-27 Thread Arne Henningsen
If you want to add rows to a data frame using rbind, your additional rows must be in a data frame with the same (column) names. R data( iris ) R a - data.frame( Sepal.Length=c(1:4), Sepal.Width=c(2:5), Petal.Length=c(3:6), Petal.Width=c(4:7), Species=rep(rosa,4)) R b - iris[1:10,] R