densityCognostics: Default cognostics for density plots in Trelliscope

View source: R/densityCognostics.R

densityCognosticsR Documentation

Default cognostics for density plots in Trelliscope

Description

The densityCognostics function provides a set of default cognostics to be used with density plots in Trelliscope. The densityCognostics function accepts the name of the variable used for the density plot and returns a function that may be applied to each ftmsData object, as is appropriate for use with the makeDisplay function. See Examples section for use.

Usage

densityCognostics(variable)

Arguments

variable

column name of column in e_meta which should be plotted. Must be one of the column names in ftmsObj$e_meta that contains numeric values.

Value

a function that may be applied to objects of type peakData and groupSummary

Examples

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

vdbDir <- vdbConn(file.path(tempdir(), "trell_test"), autoYes = TRUE)
data('exampleProcessedPeakData')

## Plot density of NOSC variable for each sample
sampleDdo <- divideBySample(exampleProcessedPeakData)
panelFn1 <- panelFunctionGenerator("densityPlot", variable="NOSC")
makeDisplay(sampleDdo, 
            panelFn=panelFn1,
            cogFn=densityCognostics("NOSC"),
            name = "NOSC_density_by_sample",
            group = "Sample")

## Plot density of NOSC for each group
groupDdo <- divideByGroup(exampleProcessedPeakData)
panelFn2 <- panelFunctionGenerator("densityPlot", variable="NOSC", groups=NA)

makeDisplay(groupDdo, 
            panelFn=panelFn2,
            cogFn=densityCognostics("NOSC"),
            name = "NOSC_density_by_group",
            group = "Group")

view()

## End(Not run)

EMSL-Computing/fticRanalysis documentation built on March 23, 2024, 8:36 p.m.