position {maSigPro} | R Documentation |
Finds the column position of a character variable in the column names of a data frame.
position(matrix, vari)
matrix |
matrix or data.frame with character column names |
vari |
character variable |
numerical. Column position for the given variable.
Ana Conesa, aconesa@ivia.es
x <- matrix(c(1, 1, 2, 2, 3, 3),ncol = 3,nrow = 2) colnames(x) <- c("one", "two", "three") position(x, "one")