Learn R Programming

wrMisc (version 1.15.3.1)

nonredDataFrame: Filter for unique elements

Description

nonredDataFrame filters 'x' (list of char-vectors or char-vector) for elements unique (to 'ref' or if NULL to all 'x') and of character length. May be used for different 'accession' for same pep sequence (same 'peptide_id'). Note : made for treating data.frames, may be slightly slower than matrix equivalent

Usage

nonredDataFrame(
  dataFr,
  useCol = c(pepID = "peptide_id", protID = "accession", seq = "sequence", mod =
    "modifications"),
  sepCollapse = "//",
  callFrom = NULL
)

Value

This function returns a data.frame of filtered (fewer lines) with additional 2 columns 'nSamePep' (number of redundant entries) and 'concID' (concatenated content)

Arguments

dataFr

(data.frame) main inpput

useCol

(character,length=2) comlumn names of 'dataFr' to use : 1st value designates where redundant values should be gathered; 2nd value designes column of which information should be concatenated

sepCollapse

(character) conatenation symbol

callFrom

(character) allow easier tracking of messages produced

See Also

combineRedBasedOnCol, correctToUnique, unique

Examples

Run this code
df1 <- data.frame(cbind(xA=letters[1:5], xB=c("h","h","f","e","f"), xC=LETTERS[1:5])) 
nonredDataFrame(df1, useCol=c("xB","xC")) 

Run the code above in your browser using DataLab