I have matrix g:
> g[1:5,1:5]
rs7510853 rs10154488 rs12159982 rs2844887 rs2844888
NA06985 \"CC\" \"CC\" \"CC\" \
When working with indexing, you cannot use "negative" character vectors. You can convert to logical with %in%
g[!rownames(g) %in% remove, ]
If you really wanted to use negative-indexing this could be done:
g[-which(rownames(g) %in% remove), ]
... however it has a nasty potential erroneous result that arises when there are not any rownames in the target vector. The result may be no values returned.