graphics-mass_dataset: Create a ggplot object from mass_dataset class

ggplot_mass_datasetR Documentation

Create a ggplot object from mass_dataset class

Description

Create a ggplot object from mass_dataset class

Usage

ggplot_mass_dataset(
  object,
  direction = c("variable", "sample"),
  variable_index = 1,
  variable_id,
  sample_index = 1,
  sample_id
)

Arguments

object

(required) mass_dataset class object.

direction

variable or sample

variable_index

variable index

variable_id

variable ID

sample_index

sample index

sample_id

sample ID

Value

A ggplot class

Author(s)

Xiaotao Shen shenxt1990@outlook.com

Examples

data("expression_data")
data("sample_info")
data("variable_info")
object =
  create_mass_dataset(
    expression_data = expression_data,
    variable_info = variable_info,
    sample_info = sample_info
  )
library(ggplot2)
ggplot_mass_dataset(object, direction = "variable", 
                    variable_index = 1) +
  geom_boxplot(aes(x = class, color = class)) +
  geom_jitter(aes(x = class, color = class))

object %>% 
  `+`(1) %>% 
  log(10) %>% 
  scale() %>% 
ggplot_mass_dataset(direction = "sample", 
                    sample_index = 2) +
  geom_boxplot(aes(x = 1)) +
  geom_jitter(aes(x = 1, color = mz))

tidymass/massdataset documentation built on Oct. 17, 2022, 7:25 a.m.