View source: R/phy_drop_NA_vars.R
| phy_drop_NA_vars | R Documentation | 
Given a phyloseq object and a character vector, the function removes all NAs that are in at least one variable
phy_drop_NA_vars(physeq, variables, verbose = TRUE)
physeq | 
 a phyloseq object  | 
variables | 
 a character vector with variable names to remove NAs from  | 
verbose | 
 A   | 
a clean phyloseq object
data("GlobalPatterns")
set.seed(1111)
GlobalPatternsNA <- GlobalPatterns
GlobalPatternsNA@sam_data$newVar1 <- replicate(n = nsamples(GlobalPatternsNA), expr = sample(x =c(NA, 1,0), size = 1, prob = c(0.1, 0.4, 0.5)))
GlobalPatternsNA@sam_data$newVar2 <- replicate(n = nsamples(GlobalPatternsNA), expr = sample(x =c(NA, 1,0), size = 1, prob = c(0.1, 0.4, 0.5)))
drop_NA_from_phyloseq_vars(physeq = GlobalPatternsNA, vars = c("newVar1", "newVar2"))
GlobalPatterns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.