I have a matrix of entries:
testMat <- matrix(1:30, nrow = 10)
rownames(testMat) <- letters[1:10]
... and a list of growth names:
rem <- c("d", "e", "f", "i")
Retrieving a matrix containing only rows with names contained in the rem list is easy:
testMat[rem,]
Following this logic, I would like to remove the rows with the names indicated in the "rem" list from the matrix. But
testMat[-rem,]
not working with Error in -rem : invalid argument to unary operator. Why is this not working?
source
share