
Last chance! 50% off unlimited learning
Sale ends in
This function works similar to unique
, but it takes a matrix as input and considers one specified column to find unique instances.
It identifies 'repeated' lines of the input-matrix (or data.frame) 'mat' based on (repeated) elements in/of column with name 'colNa' (or column-number).
Redundant lines (ie repeated lines) will disappear in output.
Eg used with extracted annotation where 1 gene has many lines for different GO annotation.
combineRedBasedOnCol(mat, colNa, sep = ",", silent = FALSE, callFrom = NULL)
input matrix or data.frame
character vector (length 1) macting 1 column name (if mult only 1st will be used), in case of mult matches only 1st used
(character) separator (default=",")
(logical) suppress messages
(character) allow easier tracking of message(s) produced
matrix containing the input matrix without lines considered repeated (unique-like)
# NOT RUN {
matr <- matrix(c(letters[1:6],"h","h","f","e",LETTERS[1:5]),ncol=3,
dimnames=list(letters[11:15],c("xA","xB","xC")))
combineRedBasedOnCol(matr,colN="xB")
combineRedBasedOnCol(rbind(matr[1,],matr),colN="xB")
# }
Run the code above in your browser using DataLab