search for: colnm1

Displaying 1 result from an estimated 1 matches for "colnm1".

Did you mean: colnms
2010 Oct 14
1
rbind ing matrices and resetting column numbers
Sorry for the verbose example. I want to row bind two matrices, and all works except I want the column labelled "row" to be sequential in the new matrix, shown as "mat3" here, i.e. needs to be 1:6 and not 1:3 repeated twice. Any suggestions? Thanks J > colnm1 <- c("row","ti","counti") > colnm2 <- c("row","tj","countj") > mat1 <- matrix(c(1,7,9,2,8,5,3,7,9),byrow=T,nrow=3) > colnames(mat1) <- colnm1 > mat1 row ti counti [1,] 1 7 9 [2,] 2 8 5 [3,] 3...