Question: filter rows by missing values frequency
0
3.5 years ago by
rgescudero0 wrote:

Does anybody has an R script to filter rows (genes) from a gene expression datamatrix, depending on the frequency of missing data along the samples? Let's say that I only want to analyze genes in a datamatrix having non-missing values in 90% of the samples.

Many thanks

Ramon

filter missing data • 479 views
modified 3.5 years ago by James W. MacDonald50k • written 3.5 years ago by rgescudero0
Answer: filter rows by missing values frequency
1
3.5 years ago by
United States
James W. MacDonald50k wrote:

You don't need an R script, per se. Unless you call a one-liner a script. Assume you have a matrix called 'thematrix'.

thecount <- ceiling(ncol(thematrix) * 0.1)
filtered <- thematrix[rowSums(is.na(thematrix)) <= thecount,]