What are advantages of rbind and cbind over matrix in R

r

#1

While studying about the matrix I came across the three methods of creation of matrix
1-matrix()
2-cbind
3-rbind
I want to know what are advantage of binding over the matrix() and where to use each of them


#2

For example:

first_row <- c(1,2,3)
second_row <- c(10,20,30)
third_row <- c(100,200,300)
fourth_row <- c(1000,1000,1000)

tmp <- rbind(first_row, second_row, third_row, fourth_row)

row_scores <- rowSums(tmp)

scores <- cbind(tmp, row_scores)

rownames(scores) <- c(“row1”, “row2”, “row3”, “row4”)
colnames(scores) <- c(“c1”, “c2”, “c3”, “total”)

I hope this help.