plotStudy()
invokes a custom plotting function saved within an OmicNavigator
study. This function is called by the app using the study-model-test
selection, feature selections, and plotting function metadata (see
addPlots()
) to define arguments.
plotStudy(study, modelID, featureID, plotID, testID = NULL, libraries = NULL)
This function is called for the side effect of creating a plot. It invisibly
returns the result from the custom plotting function specified by plotID
.
Previously it invisibly returned the study object. It's unlikely you relied
on this behavior. For a ggplot2 plot, the return value will be the plotting
object with class "ggplot"
. For a plotly plot, the return value will be
the json schema used for plotting with class “json”
.
An OmicNavigator study. Either an object of class onStudy
,
or the name of an installed study package.
Filter by modelID
Filter by featureID
Filter by plotID
Filter by testID
The directories to search for installed study packages. If
left as NULL
(the default), then
installed.packages
will use the result of
.libPaths
.
The arguments study
, modelID
, featureID
, and
testID
are passed to the function getPlottingData()
. The list returned
by getPlottingData()
is passed as the first argument to a custom plotting
function. Some custom plotTypes
(see addPlots()
) require care when being
invoked and attention should be paid to how a custom plot will be rendered
by the app. Custom plots with plotType = c(‘multiModel’, ‘singleTest’)
accept a modelID
vector of length n and a vector of testID
s length n,
where n is the number of models. Custom plots with plotType = c(‘multiModel’, ‘multiTest’)
accept modelID
and testID
vectors of
length m, where m is the total number of tests considered across all models
(note testID
s are often repeated across models). Note that the index
positions of these two vectors should correspond. That is, testID
position
1 should be found in the model specified by modelID
position 1, etc.
The app will invoke custom plotting functions via plotStudy()
using the
current menu selections and plot metadata (see addPlots()
). Plots with
plotType = ‘multiTest’
will be invoked with all testID
s found within the
currently selected model. Plots with plotType = c(‘multiModel’,‘singleTest’)
will be invoked with all modelID
s within the
study (unless the plot has specified a list of models via models
) and the
currently selected testID
(an error will result if the currently selected
testID
is not present in all relevant models for the plot). Plots with
plotType = c(‘multiModel’, ‘multiTest’)
will be invoked with all
modelID
s within the study (unless the plot has specified a list of models
via models
) and all identical testID
s across models (if there are no
matching testIDs across models an error will result).
addPlots
, getPlottingData