Re: [R] newbie- how to add a row to a matrix

From: Martin Lam <tmlammail_at_yahoo.com>
Date: Thu 18 Aug 2005 - 08:34:00 EST


# row bind
a <- matrix(1:5)
a
a <- rbind(a, 6)
a

# column bind
b <- matrix(1:5)
b
b <- cbind(b, 6:12)
b
b <- cbind(b, 13)
b

Hope this helps,

Martin

> dear list,
> if I have a matrix
>
> s<-matrix(1:5, ncol=5)
>
> how can I add another row with other data to that
> matrix?
>
> thank you,
> simone
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Aug 18 08:39:04 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:50 EST