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

Simone Gabbriellini ogabbrie at tin.it
Thu Aug 18 10:47:20 CEST 2005


thank you all

rbind solved my problems!!!

simone

Il giorno 18/ago/05, alle ore 00:34, Martin Lam ha scritto:

> # 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
>
>
> --- Simone Gabbriellini <ogabbrie at tin.it> wrote:
>
>
>> 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 at 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
>>
>>
>
>
>
>
> __________________________________
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html
>
>




More information about the R-help mailing list