ggplotify: Reshape data to the way 'ggplot2' likes it

View source: R/accessory.R

ggplotifyR Documentation

Reshape data to the way ggplot2 likes it

Description

Reshape data to the way ggplot2 likes it

Usage

ggplotify(
  plotmatrices,
  experiment,
  colorby = NULL,
  value_type = "expression",
  annotate_samples = FALSE,
  should_log = NULL
)

Arguments

plotmatrices

A matrix of values, e.g. expression data

experiment

A data frame with rows matching the columns of matrix

colorby

An optional string specifying a column from experiment that will be used to set a color column in the reshaped output.

value_type

Type of data to assemble. By default this is just expression values, but can be 'density' to calculate expression densities.

annotate_samples

Add a suffix to sample labels reflecting their group?

should_log

A boolean indicating if the log2 transformation should be applied. If TRUE, log2 transformation is applied unconditionally. If FALSE, no transformation is applied. If NULL (default), a conditional transformation based on threshold is applied.

Value

A reshaped data frame

Examples

plotdata <- ggplotify(as.matrix(plotmatrix), experiment, colorby)


pinin4fjords/shinyngs documentation built on Feb. 28, 2024, 10:19 a.m.