Learn R Programming

CountClust (version 1.0.2)

handleNA: Deal with NAs in the dataset!

Description

This function handles the NA values in the count data. If for a feature, the proportion of NAs is greater than threshold proportion, then we remove the feature, otherwise we use MAR substitution scheme using the distribution of the non NA values for the feature. If threshold proportion is 0, it implies removal of all features with NA values. Default value of threshold proportion is 0.

Usage

handleNA(data, thresh_prop = 0)

Arguments

data
count data in a sample by feature matrix.
thresh_prop
threshold proportion of NAs for removal of feature or replacing the NA values.

Value

Returns a list with
data
The modified data with NA substitution and removal
na_removed_cols
The columns in the data with NAs that were removed
na_sub_cols
The columns in the data with NAs that were substituted

Details

This function removes NAs from the counts data

Examples

Run this code
mat <- rbind(c(2,4,NA),c(4,7,8),c(3,NA,NA));
handleNA(mat,thresh_prop=0.5)
handleNA(mat)

Run the code above in your browser using DataLab