mergeDuplicate: Merge the duplicate Ids in the matrix data

View source: R/mergeDuplicate.R

mergeDuplicateR Documentation

Merge the duplicate Ids in the matrix data

Description

The mergeDuplicate function will merge the duplicate Ids in the matrix data and return the matrix with unique Ids. This function can also used to merge the duplicate mapped Ids when transforming the Ids of data matrix to other Ids.

Usage

	mergeDuplicate(id, data, collapse_mode="maxSD")

Arguments

id

Duplicate Ids that should be a vector object in R.

data

the corresponding data matrix that has the same number of rows with id and should be a matrix or data.frame object in R.

collapse_mode

The method to collapse duplicate ids. "mean", "median", "maxSD", "maxIQR", "max" and "min" represent the mean, median, max standard deviation, max interquartile range, maximum and minimum of values for ids in each sample. The default is "maxSD".

Value

The function will return the data matrix with unique Ids.

Author(s)

Jing Wang

Examples

	inputMatDir <- system.file("extdata","exampleExpressionData_nonsymbol.cct",package="NetSAM")
	inputMat <- read.table(inputMatDir,header=TRUE,sep="\t",stringsAsFactors=FALSE,check.names=FALSE)
	mergedData <- mergeDuplicate(id=inputMat[,1],data=inputMat[,2:ncol(inputMat)],collapse_mode="maxSD")

bingzhang16/NetSAM documentation built on March 24, 2023, 6:02 a.m.