panelFunctionGenerator: Convenience function to wrap ftmsRanalysis plotting functions...

View source: R/panelFunctionGenerator.R

panelFunctionGeneratorR Documentation

Convenience function to wrap ftmsRanalysis plotting functions for Trelliscope

Description

Convenience function to wrap ftmsRanalysis plotting functions for Trelliscope

Usage

panelFunctionGenerator(plot_fn_name, ...)

Arguments

plot_fn_name

plot function name, e.g. "vanKrevelenPlot" or "kendrickPlot"

...

other parameters to pass to the plotting function other than the data object

Details

Sometimes the additional parameters to pass to the plotting function will depend on the key associated with the data in the ddo (e.g. if a column name is prepended with the group name). In that case, see example below for how to construct an expr statement to obtain the necessary information.

Author(s)

Amanda White

Examples

## Not run: 
library(ftmsRanalysis)
library(trelliscope)

vdbDir <- vdbConn(file.path(tempdir(), "trell_test"), autoYes = TRUE) #temporary directory

data('exampleProcessedPeakData')
groupDdo <- divideByGroup(exampleProcessedPeakData)
groupSummaryDdo <- summarizeGroups(groupDdo, summary_functions = c("prop_present", "n_present"))

# See rlang::expr here:
panelFnG1 <- panelFunctionGenerator(
  "vanKrevelenPlot", 
  colorCName=rlang::expr(paste0(getSplitVar(v, "Group"), "_prop_present")), 
  legendTitle="Proportion<br>Present")

makeDisplay(groupSummaryDdo, 
            panelFn=panelFnG1,
            name = "Trelliscope test G_1 with VK plot per group",
            group = "Group")
view()

## End(Not run)

EMSL-Computing/fticRanalysis documentation built on Dec. 18, 2024, 9:51 p.m.