Suppose I have a matrix called mymat. I need to exclude columns key and AMLM12014N-R and make another matrix called newmat. I can simply do this like this: newmat <- mymat[,-c(1,4)], but is there a way to do it by calling column name itself? Something like this: newmat <- mymat[,-c("key","AMLM12014N-R")] ?
mymat <- structure(c("chr5:12111", "chr5:12111", "chr5:12113", "chr5:12114", 
"chr5:12118", "0N", "0N", "1N", "0N", "0N", "00", "00", "00", 
"11", "10", "00", "00", "1N", "0N", "00"), .Dim = c(5L, 4L), .Dimnames = list(
    c("34", "35", "36", "37", "38"), c("key", "AMLM12001KP", 
    "AMAS-11.3-Diagnostic", "AMLM12014N-R")))
 
    