/*
使用cbind在表中添加数据。
*/
userName <- c("Lam Wei Wei", "Zheng Da Shi", "Lin Da You", "Fei Gu Man", "Chen Kuang", "Wong wei yun")
salary <- c(8500, 9800, 12500, 15000, 8700, 7500)
jobPosition <- c("Staff", "Manger", "BOSS", "CEO", "Staff", "Staff")
bonus <- c(2300, 1350, 3285, 1035, 3285, 1035)
MixInfo = c(userName, salary, jobPosition, bonus)
result <- matrix(MixInfo, nrow = 4, ncol = 6, byrow = TRUE)
newUserName <- "Lam Ka Hai"
newSalary <- 15000
newJobPosition <- "CTO"
newBonus <- 3600
NewInfo = c(newUserName, newSalary, newJobPosition, newBonus)
NewMatr <- matrix(NewInfo, nrow = 4, ncol = 1, byrow = TRUE)
NewResult <- cbind(result, NewMatr)
rownames(NewResult) <- c("userName", "salary", "jobPosition", "bonus")
NewResult