I have a matrix with the following row.names:
\"X1\" \"X5\" \"X33\" \"X37\" \"X52\" \"X566\"
Now I want to select only the rows whic
Just in case someone's include_list is class list (rather than vector), then this is modification of Rich Scriven's answer that works in such case based on this. unlist() should be added:
m <- matrix(1:30, 6, 5)
rownames(m) <- c("X1", "X5", "X33", "X37", "X52", "X566")
include_list <- list("X1", "X5", "X33")
m[unlist(include_list), ]