parse_plot_features: Returns a list of summary statistics for a plotly plot,...

Description Usage Arguments Details Value Examples

View source: R/plots.R

Description

Returns a list of summary statistics for a plotly plot, provided as a list e.g. from jsonlite.

Usage

1
2
3
4
5
6
parse_plot_features(
  plot_data,
  prefix,
  extractor = extract_ignore_x,
  summary = list(mean = mean)
)

Arguments

plot_data

A list containing the names plot_type, datasets and config.

prefix

The prefix for this plot type in the final data frame

extractor

A function which converts the raw plot JSON into a vector

summary

A function that maps a vector to a scalar

Details

This is an internal function that may be of some use to those who want to extract data from plotly JSON, outside of the context of MultiQC. If you are trying to extract data from a MultiQC report, please use the normal load_multiqc() function instead. Please also refer to load_multiqc() for more information on these arguments, as they are identical to the elements of the plot_opts list.

Value

A list of samples, each containing a list of plots, each containing a list of summary stats

Examples

1
2
3
4
5
6
7
8
parse_plot_features(
  plot_data=jsonlite::read_json(
    system.file(
      "extdata", "wgs/multiqc_data.json", package = "TidyMultiqc"
    )
  )$report_plot_data$snpeff_effects,
  prefix='effects'
)

TidyMultiqc documentation built on April 9, 2021, 9:07 a.m.