featurePlot | R Documentation |
Plot association between abundance of a feature and predictor
, modified if paired
and covars
are available
featurePlot( data, predictor, paired = NULL, covars = NULL, feature = NULL, relative = TRUE, logScale = FALSE, delta = 0.001, covar.quant = c(0, 1/3, 2/3, 1) )
data |
Either a matrix with counts/abundances, OR a |
predictor |
The predictor of interest. Either a Factor or Numeric, OR if |
paired |
For paired/blocked experimental designs. Either a Factor with Subject/Block ID for running paired/blocked analysis, OR if |
covars |
Either a named list with covariates, OR if data is a phyloseq object a character vector with names of the variables in |
feature |
Name of feature to plot. Should be in rownames of |
relative |
Logical. If TRUE (default) abundances are made relative |
logScale |
Logical. Should abundances be log10-scaled? After normalization if relative is TRUE. Default FALSE |
delta |
Pseudocount for log10 normalization |
covar.quant |
Quantiles for cutting quantitative |
Boxplot for categorical variables, points and smooth line for quantitative variable.
If a paired
variable is supplied, it is always plotted as points with lines grouped by the paired
variable
If covars
are supplied data is split in facets. Quantitative covars are cut in intervals according to the quantiles given in covar.quant
A ggplot
# Create random count_table and predictor set.seed(5) mat <- matrix(rnbinom(500, size = 0.1, mu = 500), nrow = 50, ncol = 10) pred <- c(rep("Control", 5), rep("Treatment", 5)) rownames(mat) <- 1:50 featurePlot(mat, pred, feature = "5")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.