[R] How to stack row vector on top of each other?
Pascal Oettli
kridox at ymail.com
Fri Feb 15 02:17:04 CET 2013
Hi,
Actually, ?"c"
> a <- rnorm(10)
> b <- rnorm(10)
> d <- c(a,b)
> length(d)
[1] 20
HTH,
Pascal
Le 15/02/2013 10:08, C W a écrit :
> Hi list,
> How do you actually stack a vector on top of each other? Say, I want
> everything in a row vector. Neither rbind(), nor cbind() will do the job.
> It gives me 2 dimension.
>
> Here's my reproducible example:
>> a <- rnorm(10)
>> b <- rnorm(10)
>> c <- cbind(a,b)
>> dim(c)
> [1] 10 2
>
>> d <- rbind(a,b)
>> dim(d)
> [1] 2 10
>
> Thanks,
> Mike
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>
More information about the R-help
mailing list