data.imputation: Data imputation

Description Usage Arguments Value Examples

View source: R/DataProcess.R

Description

Data imputation for features with missing values

Usage

1
data.imputation(Data, fun = "median")

Arguments

Data

A matrix representing the genomic data such as gene expression data, miRNA expression data.
For the matrix, the rows represent the genomic features, and the columns represent the samples.

fun

A character value representing the imputation type. The optional values are shown below:

  • "median". The NAs will be replaced by the median of the existing values of this feature in all samples.

  • "mean". The NAs will be replaced by the mean of the existing values of this feature in all samples.

  • "microarray". It will apply the "impute" package to impute the missing values. This is a common way to process the missing observation for MicroArray dataset.

Value

The data matrix after imputation (without NAs).

Examples

1
2
3
4
5
6
7
8
Data=matrix(runif(1000),nrow = 50,ncol = 20)
geneName=paste("Gene", 1:50, sep = " ")
sampleName=paste("Sample", 1:20, sep = " ")
rownames(Data)=geneName
colnames(Data)=sampleName
index=sample(c(1:1000),60)
Data[index]=NA
result=data.imputation(Data,fun="median")

xtsvm/CancerSubtypes documentation built on May 4, 2019, 1:26 p.m.