m <- matrix(c(200, 100, 0, 80, 200, 20, 20, 80, 100, 0, 20, 180), nrow = 3, ncol = 4)

rownames(m) <- c("0-5", "5-10", "10-30")

colnames(m) <- c("1-10", "10-21", "21-40", "40-60")

t <- cbind(m, c(200+ 80+20+ 0), c(100+200+80+20), c(0+20+100+180))

View(t)

anyone can help me to perform same as like in the picture. Any other way to do like this? I am confused to perform same as like in the picture. above is code .