R returning partial matching of row names
问题 I've run into the following issue vec <- c("a11","b21","c31") df <- data.frame(a = c(0,0,0), b = c(1,1,1), row.names = vec) df["a",] returns df["a",] a b a11 0 1 However, "a" %in% vec and "a" %in% rownames(df) both return False R is allowing for partial matching of the string when using letter followed by numbers for row names. I have replicated this on R v3.2.2 and R v3.2.1. Even df[["a",1,exact=T]] returns 0 Is there anything I can set such that R does not allow this partial matching? 回答1: