Skip to content
Prev 75752 / 398502 Next

newbie- how to add a row to a matrix

# 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: