shimgo
3/21/2018 - 12:54 PM

行列を作る

行ベクトルを与える場合

> rbind(c(1,2,3),c(4,5,6))
# =>
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    4    5    6

列ベクトルを与える場合

> cbind(c(1,2,3),c(4,5,6))
     [,1] [,2]
[1,]    1    4
[2,]    2    5
[3,]    3    6
>