greedy.pairwise.n.filter: greedy selection

View source: R/greedy.pairwise.n.filter.R

greedy.pairwise.n.filterR Documentation

greedy selection

Description

This function identifies features that have less than a minimum number of complete pairwise observations and removes one of them, in a greedy fashion. The need for this function is in instances where missingness is extreme between two features the number of paired observation between them may be to to be informative. Thus one, but not both should be removed from the analysis to avoid analytical error based on sample sizes.

Usage

greedy.pairwise.n.filter(wdata, minN = 50)

Arguments

wdata

the metabolite data matrix. samples in row, metabolites in columns

minN

the minimum sample size (n) for pairwise comparisons

Value

a vector of feature names

Examples

set.seed(123)
ex_data = sapply(1:10, function(x){ rnorm(250, 40, 5) })
## define the data set
rownames(ex_data) = paste0("ind", 1:nrow(ex_data))
colnames(ex_data) = paste0("var", 1:ncol(ex_data))
## add in some missingness
ex_data[ sample(1:250, 200) ,1] = NA
ex_data[ sample(1:250, 200) ,2] = NA
ex_data[ sample(1:250, 200) ,3] = NA
## Estimate missingness and generate plots
greedy.pairwise.n.filter(ex_data)



MRCIEU/metaboprep documentation built on Jan. 28, 2023, 7:29 p.m.