Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- B[1-10] <- A[2-6, and 11-16]
- # example 1 column matrix
- A <- matrix(1:20, ncol = 1)
- B <- A[ c(2:6, 11:16), 1 ]
- dim(B)
- # NULL
- class(B)
- # [1] "integer"
- B <- A[ c(2:6, 11:16), 1, drop = FALSE ]
- dim(B)
- # [1] 11 1
- class(B)
- # [1] "matrix"
- B = as.matrix (c(A[2:6,1],A[11:16,1]))
Add Comment
Please, Sign In to add comment