plot_densities {autonomics}R Documentation

Plot sample/feature densities

Description

Plot sample/feature densities

Usage

plot_densities(
  object,
  group,
  fill,
  color = NULL,
  fixed = list(alpha = 0.5, na.rm = TRUE)
)

plot_sample_densities(
  object,
  fill = sample_id,
  color = NULL,
  group = sample_id,
  fixed = list(alpha = 0.5, na.rm = TRUE),
  subsetter = if (ncol(object) < 100) {     seq_len(ncol(object)) } else {    
    sample(ncol(object), 9) }
)

plot_feature_densities(
  object,
  fill = feature_id,
  color = NULL,
  group = feature_id,
  fixed = list(alpha = 0.5, na.rm = TRUE),
  subsetter = if (nrow(object) < 100) {     seq_len(nrow(object)) } else {    
    sample(nrow(object), 9) }
)

Arguments

object

SummarizedExperiment

group

svar mapped to group

fill

svar mapped to fill

color

svar mapped to color

fixed

fixed aesthetics

subsetter

subsetter for showing a subset of samples/features

Value

ggplot object

See Also

plot_sample_violins, plot_sample_boxplots

Examples

# Read data
    require(magrittr)
    file <- download_data('atkin18.metabolon.xlsx')
    object <- read_metabolon(file, plot = FALSE)
    object %<>% extract(, order(.$Group))
# Plot distributions
    plot_sample_densities(object, fill = Group)
    plot_feature_densities(object)

[Package autonomics version 1.2.0 Index]