| Title: | TLF Library |
|---|---|
| Description: | An implementation of the Table, Listing and Figure concepts in R. This library provides a standardized approach to creating tables and graphs based on conventions over configurations. |
| Authors: | Open-Systems-Pharmacology Community [cph], Michael Sevestre [aut, cre], Pierre Chelle [aut], Abdullah Hamadeh [aut], Indrajeet Patil [ctb] (ORCID: <https://orcid.org/0000-0003-1995-6531>, Twitter: @patilindrajeets) |
| Maintainer: | Michael Sevestre <[email protected]> |
| License: | GPL-2 | file LICENSE |
| Version: | 1.6.2 |
| Built: | 2026-07-06 12:18:55 UTC |
| Source: | https://github.com/Open-Systems-Pharmacology/TLF-Library |
ggtext does not allow certain characters that can be converted to html tags but that are not supported. This function removes this forbidden characters.
.sanitizeLabel(text).sanitizeLabel(text)
text |
a character string |
a sanitized character string
Add an errorbar layer to a ggplot object.
addErrorbar( data = NULL, metaData = NULL, x = NULL, ymin = NULL, ymax = NULL, caption = NULL, color = NULL, size = NULL, linetype = NULL, capSize = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )addErrorbar( data = NULL, metaData = NULL, x = NULL, ymin = NULL, ymax = NULL, caption = NULL, color = NULL, size = NULL, linetype = NULL, capSize = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
x |
Numeric values to plot along the |
ymin |
Numeric values to plot along the |
ymax |
Numeric values to plot along the |
caption |
Optional character values defining the legend captions of the plot. |
color |
Optional character values defining the colors of the plot layer.
See |
size |
Optional numeric values defining the size of the plot layer. |
linetype |
Optional character values defining the linetype of the plot layer.
See enum |
capSize |
Numeric extent of the error bars caps
Caution the value corresponds to the ratio of the mean spacing between plotted error bars.
For instance, an |
dataMapping |
A |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/atom-plots.html
Other atom plots:
addLine(),
addRibbon(),
addScatter(),
initializePlot()
# Add errorbar using x, ymin and ymax addErrorbar( x = c(1, 2, 1, 2, 3), ymin = c(5, 0, 2, 3, 4), ymax = c(6, 2, 6, 2.5, 5) ) # Add errorbar using a data.frame time <- seq(0, 30, 0.5) errorbarData <- data.frame(x = time, ymin = cos(time) - 1, ymax = cos(time) + 1) addErrorbar( data = errorbarData, dataMapping = RangeDataMapping$new(x = "x", ymin = "ymin", ymax = "ymax") ) # Or for simple cases a smart mapping will get directly x, ymin and ymax from data addErrorbar(data = errorbarData) # Add a errorbar with caption addErrorbar(data = errorbarData, caption = "My errorbar plot") # Add a errorbar with specific properties addErrorbar(data = errorbarData, color = "blue", size = 0.5, caption = "My data") # Add a errorbar with specific properties p <- addErrorbar( data = errorbarData, color = "blue", size = 0.5, caption = "My data" ) addScatter( x = time, y = cos(time), color = "red", size = 1, caption = "My data", plotObject = p )# Add errorbar using x, ymin and ymax addErrorbar( x = c(1, 2, 1, 2, 3), ymin = c(5, 0, 2, 3, 4), ymax = c(6, 2, 6, 2.5, 5) ) # Add errorbar using a data.frame time <- seq(0, 30, 0.5) errorbarData <- data.frame(x = time, ymin = cos(time) - 1, ymax = cos(time) + 1) addErrorbar( data = errorbarData, dataMapping = RangeDataMapping$new(x = "x", ymin = "ymin", ymax = "ymax") ) # Or for simple cases a smart mapping will get directly x, ymin and ymax from data addErrorbar(data = errorbarData) # Add a errorbar with caption addErrorbar(data = errorbarData, caption = "My errorbar plot") # Add a errorbar with specific properties addErrorbar(data = errorbarData, color = "blue", size = 0.5, caption = "My data") # Add a errorbar with specific properties p <- addErrorbar( data = errorbarData, color = "blue", size = 0.5, caption = "My data" ) addScatter( x = time, y = cos(time), color = "red", size = 1, caption = "My data", plotObject = p )
Add a line layer to a ggplot object.
addLine( data = NULL, metaData = NULL, x = NULL, y = NULL, caption = NULL, color = NULL, shape = NULL, size = NULL, linetype = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )addLine( data = NULL, metaData = NULL, x = NULL, y = NULL, caption = NULL, color = NULL, shape = NULL, size = NULL, linetype = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
x |
Numeric values to plot along the |
y |
Numeric values to plot along the |
caption |
Optional character values defining the legend captions of the plot. |
color |
Optional character values defining the colors of the plot layer.
See |
shape |
Optional character values defining the shapes/symbols of the plot layer.
See enum |
size |
Optional numeric values defining the size of the plot layer. |
linetype |
Optional character values defining the linetype of the plot layer.
See enum |
dataMapping |
A |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/atom-plots.html
Other atom plots:
addErrorbar(),
addRibbon(),
addScatter(),
initializePlot()
# Add line using x and y addLine(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) # Add line using a data.frame time <- seq(0, 30, 0.1) lineData <- data.frame(x = time, y = cos(time)) addLine( data = lineData, dataMapping = XYGDataMapping$new(x = "x", y = "y") ) # Or for simple cases a smart mapping will get directly x and y from data addLine(data = lineData) # Add a line with caption addLine(data = lineData, caption = "My line plot") # Add a line with specific properties addLine( data = lineData, color = "blue", linetype = "longdash", size = 0.5, caption = "My data" ) # Add a line with specific properties p <- addLine( data = lineData, color = "blue", linetype = "longdash", size = 0.5, caption = "My data" ) addLine( x = c(0, 1), y = c(1, 0), color = "red", linetype = "solid", size = 1, plotObject = p )# Add line using x and y addLine(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) # Add line using a data.frame time <- seq(0, 30, 0.1) lineData <- data.frame(x = time, y = cos(time)) addLine( data = lineData, dataMapping = XYGDataMapping$new(x = "x", y = "y") ) # Or for simple cases a smart mapping will get directly x and y from data addLine(data = lineData) # Add a line with caption addLine(data = lineData, caption = "My line plot") # Add a line with specific properties addLine( data = lineData, color = "blue", linetype = "longdash", size = 0.5, caption = "My data" ) # Add a line with specific properties p <- addLine( data = lineData, color = "blue", linetype = "longdash", size = 0.5, caption = "My data" ) addLine( x = c(0, 1), y = c(1, 0), color = "red", linetype = "solid", size = 1, plotObject = p )
Add a ribbon layer to a ggplot object.
addRibbon( data = NULL, metaData = NULL, x = NULL, ymin = NULL, ymax = NULL, caption = NULL, fill = NULL, color = NULL, size = NULL, linetype = NULL, alpha = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )addRibbon( data = NULL, metaData = NULL, x = NULL, ymin = NULL, ymax = NULL, caption = NULL, fill = NULL, color = NULL, size = NULL, linetype = NULL, alpha = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
x |
Numeric values to plot along the |
ymin |
Numeric values to plot along the |
ymax |
Numeric values to plot along the |
caption |
Optional character values defining the legend captions of the plot. |
fill |
Optional character values defining the colors of the plot layer.
See |
color |
Optional character values defining the colors of the plot layer.
See |
size |
Optional numeric values defining the size of the plot layer. |
linetype |
Optional character values defining the linetype of the plot layer.
See enum |
alpha |
Numeric value between 0 and 1 corresponding to transparency of the ribbon. The closer to 0, the more transparent the ribbon is. The closer to 1, the more opaque the ribbon is. |
dataMapping |
A |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/atom-plots.html
Other atom plots:
addErrorbar(),
addLine(),
addScatter(),
initializePlot()
# Add ribbon using x, ymin and ymax addRibbon( x = c(1, 2, 1, 2, 3), ymin = c(5, 0, 2, 3, 4), ymax = c(6, 2, 6, 2.5, 5) ) # Add ribbon using a data.frame time <- seq(0, 30, 0.1) ribbonData <- data.frame(x = time, ymin = cos(time) - 1, ymax = cos(time) + 1) addRibbon( data = ribbonData, dataMapping = RangeDataMapping$new(x = "x", ymin = "ymin", ymax = "ymax") ) # Or for simple cases a smart mapping will get directly x, ymin and ymax from data addRibbon(data = ribbonData) # Add a ribbon with caption addRibbon(data = ribbonData, caption = "My ribbon plot") # Add a ribbon with specific properties addRibbon(data = ribbonData, fill = "blue", alpha = 0.5, caption = "My data") # Add a ribbon with specific properties p <- addRibbon(data = ribbonData, fill = "blue", alpha = 0.5, caption = "My data") addRibbon( x = c(0, 1), ymin = c(-0.5, -0.5), ymax = c(0.5, 0.5), fill = "red", alpha = 1, plotObject = p )# Add ribbon using x, ymin and ymax addRibbon( x = c(1, 2, 1, 2, 3), ymin = c(5, 0, 2, 3, 4), ymax = c(6, 2, 6, 2.5, 5) ) # Add ribbon using a data.frame time <- seq(0, 30, 0.1) ribbonData <- data.frame(x = time, ymin = cos(time) - 1, ymax = cos(time) + 1) addRibbon( data = ribbonData, dataMapping = RangeDataMapping$new(x = "x", ymin = "ymin", ymax = "ymax") ) # Or for simple cases a smart mapping will get directly x, ymin and ymax from data addRibbon(data = ribbonData) # Add a ribbon with caption addRibbon(data = ribbonData, caption = "My ribbon plot") # Add a ribbon with specific properties addRibbon(data = ribbonData, fill = "blue", alpha = 0.5, caption = "My data") # Add a ribbon with specific properties p <- addRibbon(data = ribbonData, fill = "blue", alpha = 0.5, caption = "My data") addRibbon( x = c(0, 1), ymin = c(-0.5, -0.5), ymax = c(0.5, 0.5), fill = "red", alpha = 1, plotObject = p )
Add a scatter plot layer to a ggplot object
addScatter( data = NULL, metaData = NULL, x = NULL, y = NULL, caption = NULL, color = NULL, shape = NULL, size = NULL, linetype = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )addScatter( data = NULL, metaData = NULL, x = NULL, y = NULL, caption = NULL, color = NULL, shape = NULL, size = NULL, linetype = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
x |
Numeric values to plot along the |
y |
Numeric values to plot along the |
caption |
Optional character values defining the legend captions of the plot. |
color |
Optional character values defining the colors of the plot layer.
See |
shape |
Optional character values defining the shapes/symbols of the plot layer.
See enum |
size |
Optional numeric values defining the size of the plot layer. |
linetype |
Optional character values defining the linetype of the plot layer.
See enum |
dataMapping |
A |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/atom-plots.html
Other atom plots:
addErrorbar(),
addLine(),
addRibbon(),
initializePlot()
# Add scatter using x and y addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) # Add scatter using a data.frame time <- seq(0, 30, 0.1) scatterData <- data.frame(x = time, y = cos(time)) addScatter( data = scatterData, dataMapping = XYGDataMapping$new(x = "x", y = "y") ) # Or for simple cases a smart mapping will get directly x and y from data addScatter(data = scatterData) # Add a scatter with caption addScatter(data = scatterData, caption = "My scatter plot") # Add a scatter with specific properties addScatter( data = scatterData, color = "blue", shape = "diamond", size = 2, caption = "My data" ) # Add a scatter with specific properties p <- addScatter( data = scatterData, color = "blue", shape = "diamond", size = 2, caption = "My data" ) addScatter( x = c(0, 1), y = c(1, 0), color = "red", shape = "circle", size = 3, plotObject = p )# Add scatter using x and y addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) # Add scatter using a data.frame time <- seq(0, 30, 0.1) scatterData <- data.frame(x = time, y = cos(time)) addScatter( data = scatterData, dataMapping = XYGDataMapping$new(x = "x", y = "y") ) # Or for simple cases a smart mapping will get directly x and y from data addScatter(data = scatterData) # Add a scatter with caption addScatter(data = scatterData, caption = "My scatter plot") # Add a scatter with specific properties addScatter( data = scatterData, color = "blue", shape = "diamond", size = 2, caption = "My data" ) # Add a scatter with specific properties p <- addScatter( data = scatterData, color = "blue", shape = "diamond", size = 2, caption = "My data" ) addScatter( x = c(0, 1), y = c(1, 0), color = "red", shape = "circle", size = 3, plotObject = p )
Creates a ggplot grob based on the label text and its font properties.
Then, adds the grob to the ggplot object as a new layer using ggplot2::annotation_custom.
addWatermark( plotObject, watermark, color = NULL, size = NULL, angle = NULL, alpha = NULL )addWatermark( plotObject, watermark, color = NULL, size = NULL, angle = NULL, alpha = NULL )
plotObject |
A |
watermark |
A character value or a |
color |
Color of the watermark. |
size |
Size of the watermark. |
angle |
Angle of the watermark (in degree). |
alpha |
Numeric value between 0 and 1 corresponding to transparency of the watermark The closer to 0, the more transparent the watermark is. The closer to 1, the more opaque the watermark is. |
A ggplot object
# Add a watermark to an empty plot p <- ggplot2::ggplot() addWatermark(p, "watermark") # Watermark with font properties watermarkLabel <- Label$new(text = "watermark", color = "blue") addWatermark(p, watermarkLabel) # Horizontal watermark addWatermark(p, watermarkLabel, angle = 0) # Watermark totally opaque addWatermark(p, watermarkLabel, alpha = 1) # As multiple layers of watermark: p2 <- addWatermark(p, watermarkLabel, alpha = 1) addWatermark(p2, "other watermark", color = "red", angle = 90)# Add a watermark to an empty plot p <- ggplot2::ggplot() addWatermark(p, "watermark") # Watermark with font properties watermarkLabel <- Label$new(text = "watermark", color = "blue") addWatermark(p, watermarkLabel) # Horizontal watermark addWatermark(p, watermarkLabel, angle = 0) # Watermark totally opaque addWatermark(p, watermarkLabel, alpha = 1) # As multiple layers of watermark: p2 <- addWatermark(p, watermarkLabel, alpha = 1) addWatermark(p2, "other watermark", color = "red", angle = 90)
List of all available aesthetic fields that manage aesthetic properties
AestheticFieldsAestheticFields
An object of class list of length 4.
Other enum helpers:
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Enum of aesthetic property names of ggplot2
AestheticPropertiesAestheticProperties
An object of class list of length 6.
Other enum helpers:
AestheticFields,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
List of some ggplot2 shapes
AestheticSelectionKeysAestheticSelectionKeys
An object of class list of length 4.
Other enum helpers:
AestheticFields,
AestheticProperties,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class to be used to construct inputs to the AggregationSummary class
aggregationFunctionlist of functions to use for aggregation
aggregationFunctionNamevector of function names that will be used as variable name of the aggregation
aggregationUnitunit of aggregation output
aggregationDimensiondimension of aggregation output
new()
Create a new AggregationInput object
AggregationInput$new( aggregationFunction = NULL, aggregationFunctionName = NULL, aggregationUnit = NULL, aggregationDimension = NULL )
aggregationFunctionlist of functions to use for aggregation
aggregationFunctionNamevector of function names that will be used as variable name of the aggregation
aggregationUnitunit of aggregation output
aggregationDimensiondimension of aggregation output
A new AggregationInput object
clone()
The objects of this class are cloneable with this method.
AggregationInput$clone(deep = FALSE)
deepWhether to make a deep clone.
R6 class to split a data.frame data into subsets defined by unique combinations of elements
in the columns xColumnNames and groupingColumnNames.
Applies functions defined in aggregationFunctionsVector to column yColumnNames.
Returns a list of data.frame, one data.frame for each function listed in aggregationFunctionsVector.
Each data.frame in list element is named after the function's corresponding string in aggregationFunctionNames.
The summary statistic column name in each data.frame is the same as the name of the data.frame in the returned list.
datadata.frame
metaDatalist of information on data
xColumnNamescharacter names of grouping variables
groupingColumnNamescharacter names of grouping variables
yColumnNamescharacter names of dependent variables (that are grouped)
aggregationInputsVectorlist of R6 class AggregationInput objects
aggregationFunctionsVectorlist of functions to use for aggregation
aggregationFunctionNamesvector of function names that will be used as variable name of the aggregation
aggregationUnitsVectorcharacter vector of units of aggregation output
aggregationDimensionsVectorcharacter vector of dimensions of aggregation output
dfHelperdata.frame of aggregated values
metaDataHelperlist of information on dfHelper
new()
Create a new AggregationSummary object
AggregationSummary$new( data, metaData = NULL, xColumnNames = NULL, groupingColumnNames = NULL, yColumnNames = NULL, aggregationInputsVector = NULL, aggregationFunctionsVector = NULL, aggregationFunctionNames = NULL, aggregationUnitsVector = NULL, aggregationDimensionsVector = NULL )
datadata.frame
metaDatalist of information on data
xColumnNamescharacter names of grouping variables
groupingColumnNamescharacter names of grouping variables
yColumnNamescharacter names of dependent variables (that are grouped)
aggregationInputsVectorlist of R6 class AggregationInput objects
aggregationFunctionsVectorlist of functions to use for aggregation
aggregationFunctionNamesvector of function names that will be used as variable name of the aggregation
aggregationUnitsVectorcharacter vector of units of aggregation output
aggregationDimensionsVectorcharacter vector of dimensions of aggregation output
A new AggregationSummary object
applyAggregationFunctions()
Apply aggregation functions on x
AggregationSummary$applyAggregationFunctions(x)
xnumeric vector
A list or vector of aggregated values
generateAggregatedValues()
Generate aggregated values
AggregationSummary$generateAggregatedValues()
A list or vector of aggregated values
clone()
The objects of this class are cloneable with this method.
AggregationSummary$clone(deep = FALSE)
deepWhether to make a deep clone.
List of all available alignments/justifications for fonts
AlignmentsAlignments
An object of class list of length 3.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Set a character string into a Label object associating font properties to input
If text is already a Label object, asLabel can be used to update its font properties
asLabel(text = "", font = NULL)asLabel(text = "", font = NULL)
text |
A character value |
font |
A |
A Label object
title <- "Title of Plot" title <- asLabel(title)title <- "Title of Plot" title <- asLabel(title)
List of all available atom plots
AtomPlotsAtomPlots
An object of class list of length 5.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class defining the configuration of axis
valuesLimitsnumeric vector of length 2 defining limits of axis.
A value of NULL is allowed and lead to default ggplot2 behaviour
axisLimitsnumeric vector of length 2 defining limits of axis.
A value of NULL is allowed and lead to default ggplot2 behaviour
scalename of axis scale from Enum Scaling
A value of NULL is allowed and will lead to a default linear scale
ticksfunction or values defining where axis ticks are placed
minorTicksfunction or values defining where axis minor ticks are placed
ticklabelsfunction or values defining the axis tick labels
fontFont object defining the font of the ticklabels
expandlogical defining if data is expanded until axis.
If TRUE, data is expanded until axis
If FALSE, some space between data and axis is kept
new()
Create a new AxisConfiguration object
AxisConfiguration$new( valuesLimits = NULL, axisLimits = NULL, limits = lifecycle::deprecated(), scale = Scaling$lin, ticks = NULL, ticklabels = NULL, minorTicks = NULL, font = NULL, expand = FALSE )
valuesLimitsnumeric vector of value limits (data outside these limits is removed)
axisLimitsnumeric vector of axis limits (data outside these limits is kept but not plotted)
limitsscalecharacter defining axis scale
Use enum Scaling to access predefined scales.
ticksnumeric vector or function defining where to position axis ticks
ticklabelscharacter vector or function defining what to print on axis ticks
minorTicksnumeric vector or function defining where to position minor axis ticks
fontFont object defining the font of ticklabels
expandlogical defining if data is expanded until axis.
If TRUE, data is expanded until axis
If FALSE, some space between data and axis is kept
A new AxisConfiguration object
ggplotScale()
Get the ggplot2 actual trans name of scale
AxisConfiguration$ggplotScale()
A character included in ggplot2 available trans names
ggplotExpansion()
Get the ggplot2 actual function for expansion
AxisConfiguration$ggplotExpansion()
A ggplot2 function
prettyTicks()
Get tick values for pretty default log plots
AxisConfiguration$prettyTicks()
User defined tick values or tlf default ticks
prettyMinorTicks()
Get tick values for pretty default log plots
AxisConfiguration$prettyMinorTicks()
User defined tick values or tlf default ticks
prettyTickLabels()
Get tick labels for pretty default log plots
AxisConfiguration$prettyTickLabels()
User defined tick labels or tlf default ticklabels
clone()
The objects of this class are cloneable with this method.
AxisConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
R6 class defining the configuration of background
watermarkLabel object
plotBackgroundElement object
panelBackgroundElement object
xAxisLineElement object
yAxisLineElement object
y2AxisLineElement object
xGridLineElement object
yGridLineElement object
y2GridLineElement object
new()
Create a new BackgroundConfiguration object
BackgroundConfiguration$new( watermark = NULL, plot = NULL, panel = NULL, xAxis = NULL, yAxis = NULL, y2Axis = NULL, xGrid = NULL, yGrid = NULL, y2Grid = NULL )
watermarkLabel object defining properties of watermark
plotBackgroundElement object defining outside plot background properties
panelBackgroundElement object defining panel (inside of plot) background properties
xAxisLineElement object defining properties of x-axis
yAxisLineElement object defining properties of y-axis
y2AxisLineElement object defining properties of right y-axis
xGridLineElement object defining properties of x-grid
yGridLineElement object defining properties of y-grid
y2GridLineElement object defining properties of right y-grid
A new BackgroundConfiguration object
updatePlot()
Update background a ggplot object from BackgroundConfiguration properties
BackgroundConfiguration$updatePlot(plotObject)
plotObjecta ggplot object
A ggplot object
clone()
The objects of this class are cloneable with this method.
BackgroundConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
R6 class defining the properties of background elements
fillcharacter defining the color filling of the background element
colorcharacter defining the color of the background element frame/line
sizenumeric defining the size of the background element frame/line
linetypecharacter defining the size of the background element frame/line
new()
Create a new BackgroundElement object
BackgroundElement$new(fill = NULL, color = NULL, size = NULL, linetype = NULL)
fillcharacter color filling of the background element
colorcharacter color of the frame of the background element
sizecharacter size of the frame of the background element
linetypecharacter linetype of the frame of the background element
A new BackgroundElement object
createPlotElement()
Create a ggplot2::element_rect directly usable by ggplot2::theme.
BackgroundElement$createPlotElement( fill = NULL, color = NULL, size = NULL, linetype = NULL )
fillcharacter color filling of the background element
colorcharacter color of the frame of the background element
sizecharacter size of the frame of the background element
linetypecharacter linetype of the frame of the background element
An element_rect object.
clone()
The objects of this class are cloneable with this method.
BackgroundElement$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
R6 class for mapping y, GroupMapping, boxWhiskerLimits and outlierLimits to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> BoxWhiskerDataMapping
outlierLimitsList of minOutlierLimit and maxOutlierLimit functions
outside which data is flagged as outlier
boxWhiskerLimitsList of ymin, lower, middle, upper and ymax functions
calculated on data to obtain box whiskers
new()
Create a new BoxWhiskerDataMapping object
BoxWhiskerDataMapping$new( x = NULL, y, ymin = tlfStatFunctions$`Percentile5%`, lower = tlfStatFunctions$`Percentile25%`, middle = tlfStatFunctions$`Percentile50%`, upper = tlfStatFunctions$`Percentile75%`, ymax = tlfStatFunctions$`Percentile95%`, minOutlierLimit = tlfStatFunctions$`Percentile25%-1.5IQR`, maxOutlierLimit = tlfStatFunctions$`Percentile75%+1.5IQR`, ... )
xName of x variable to map Default value is NULL in case of a unique box in the boxplot.
yName of y variable to map
yminName of function used for calculating lower whisker.
Default value is Percentile5%.
lowerName of function used for calculating lower line of box
Default value is Percentile25%.
middleName of function used for calculating middle line
Default value is Percentile55%.
upperName of function used for calculating upper line of box
Default value is Percentile75%.
ymaxName of function used for calculating upper whisker
Default value is Percentile95%.
minOutlierLimitName of function used for calculating lower outlier limit
Default value is Percentile25-1.5IQR%.
maxOutlierLimitName of function used for calculating upper outlier limit
Default value is Percentile75+1.5IQR%.
...parameters inherited from XYGDataMapping
A new BoxWhiskerDataMapping object
getBoxWhiskerLimits()
Get a data.frame with box-whisker limit by group
BoxWhiskerDataMapping$getBoxWhiskerLimits(data)
datadata.frame to check
A data.frame with ymin, lower, middle, upper, ymax variables.
getOutliers()
Get a data.frame flagging outliers
BoxWhiskerDataMapping$getOutliers(data)
datadata.frame to check
A data.frame with minOutliers and maxOutliers variables.
Values not flagged are NA in the outliers variables
clone()
The objects of this class are cloneable with this method.
BoxWhiskerDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for boxplots
tlf::PlotConfiguration -> BoxWhiskerPlotConfiguration
defaultXScaleDefault xAxis scale value when creating a BoxWhiskerPlotConfiguration object
outlierslogical defining if outliers should be included in boxplot
new()
Create a new BoxWhiskerPlotConfiguration object
BoxWhiskerPlotConfiguration$new(outliers = TRUE, ...)
outlierslogical defining if outliers should be included in boxplot
...parameters inherited from PlotConfiguration
A new BoxWhiskerPlotConfiguration object
clone()
The objects of this class are cloneable with this method.
BoxWhiskerPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
List with some color maps for Theme object.
The ospDefault color map is based on colors in default_igv qualitative
color palette from {ggsci} package.
ColorMapsColorMaps
An object of class list of length 6.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Enum of available color palettes
First color palettes come from viridis
Remaining color palettes are from RColorBrewer
ColorPalettesColorPalettes
An object of class list of length 42.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Creates a ggplot grob based on the label text and its font properties.
createWatermarkGrob(label, alpha = NULL)createWatermarkGrob(label, alpha = NULL)
label |
A character value or |
alpha |
Numeric value between 0 and 1 corresponding to transparency of the watermark The closer to 0, the more transparent the watermark is. The closer to 1, the more opaque the watermark is. |
A ggplot grob
R6 class for mapping x, y, GroupMapping variables to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> CumulativeTimeProfileDataMapping
clone()
The objects of this class are cloneable with this method.
CumulativeTimeProfileDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for cumulative time profile plots
tlf::PlotConfiguration -> CumulativeTimeProfilePlotConfiguration
defaultExpandDefault expand value when creating a CumulativeTimeProfilePlotConfiguration object
colorPalettecolor palette property from ggplot2
new()
Create a new CumulativeTimeProfilePlotConfiguration object
CumulativeTimeProfilePlotConfiguration$new(colorPalette = NULL, ...)
colorPalettecolor palette property from ggplot2
...parameters inherited from PlotConfiguration
A new CumulativeTimeProfilePlotConfiguration object
clone()
The objects of this class are cloneable with this method.
CumulativeTimeProfilePlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
List of all available molecule plots
DataMappingsDataMappings
An object of class list of length 18.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class for mapping x, y, GroupMapping and DDI ratio lines variables to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> tlf::PKRatioDataMapping -> DDIRatioDataMapping
deltaGuestValue of delta in Guest et al. equation
minRangeMinimum range of x values for guest and ratio lines
residualsVsObservedLogical defining if calculated DDI data are as residuals vs observed or predicted vs observed
new()
Create a new DDIRatioDataMapping object
DDIRatioDataMapping$new( deltaGuest = NULL, minRange = c(0.01, 100), lines = DefaultDataMappingValues$ddiRatio, residualsVsObserved = FALSE, ... )
deltaGuestValue of delta in Guest et al. equation.
Default value is 1.
minRangeMinimum range of x values for guest and ratio lines Default is [0.01 - 100]
linesList of ratio limits to display as diagonal/horizontal lines
residualsVsObservedLogical defining if calculated DDI data are as residuals vs observed or predicted vs observed
...parameters inherited from PKRatioDataMapping
A new DDIRatioDataMapping object
clone()
The objects of this class are cloneable with this method.
DDIRatioDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for DDI ratio plots
tlf::PlotConfiguration -> DDIRatioPlotConfiguration
defaultXScaleDefault xAxis scale value when creating a DDIRatioPlotConfiguration object
defaultYScaleDefault yAxis scale value when creating a DDIRatioPlotConfiguration object
defaultExpandDefault expand value when creating a DDIRatioPlotConfiguration object
clone()
The objects of this class are cloneable with this method.
DDIRatioPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
List of default values used in dataMapping
DefaultDataMappingValuesDefaultDataMappingValues
An object of class list of length 7.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Enum of plotting directions for errorbars and lloq lines.
DirectionsDirections
An object of class list of length 3.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class defining properties for saving a ggplot object
namecharacter defining the name of the file to be saved (without extension)
pathPath of the directory to save plot to: path and filename are combined to create the fully qualified file name. Defaults to the working directory.
formatcharacter defining the format of the file to be saved
widthnumeric values defining the width in units of the plot dimensions after saving
heightnumeric values defining the height in units of the plot dimensions after saving
unitscharacter defining the unit of the saving dimension
dpi(dots per inch) numeric value defining plot resolution
new()
Create a new ExportConfiguration object
ExportConfiguration$new( path = NULL, name = NULL, format = NULL, width = NULL, height = NULL, units = NULL, dpi = NULL )
pathPath of the directory to save plot to: path and filename are combined to create the fully qualified file name. Defaults to the working directory.
namecharacter defining the name of the file to be saved (without extension)
formatcharacter defining the format of the file to be saved.
widthnumeric values defining the width in units of the plot dimensions after saving
heightnumeric values defining the height in units of the plot dimensions after saving
unitscharacter defining the unit of the saving dimension
dpinumeric value defining plot resolution (dots per inch)
A new ExportConfiguration object
print()
Print properties of export configuration
ExportConfiguration$print()
Export configuration properties
getFileName()
Print the default exported file name from the export configuration
ExportConfiguration$getFileName()
Default file name
savePlot()
Save/Export a plot
ExportConfiguration$savePlot(plotObject, fileName = NULL)
plotObjectA ggplot object
fileNamecharacter file name of the exported plot
The file name of the exported plot
convertPixels()
If unit is in pixels, convert all export dimensions to inches to keep compatibility with older versions of ggplot2
ExportConfiguration$convertPixels()
clone()
The objects of this class are cloneable with this method.
ExportConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
List of all available formats to export a ggplot object
ExportFormatsExportFormats
An object of class list of length 10.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Save a ggplot object according to its export properties
exportPlot( plotObject, fileName = NULL, name = NULL, format = NULL, width = NULL, height = NULL, units = NULL, dpi = NULL )exportPlot( plotObject, fileName = NULL, name = NULL, format = NULL, width = NULL, height = NULL, units = NULL, dpi = NULL )
plotObject |
Graphical object created from ggplot |
fileName |
name of exported file (with extension) |
name |
character defining the name of the file to be saved (without extension) |
format |
character defining the format of the file to be saved. |
width |
numeric values defining the width in |
height |
numeric values defining the height in |
units |
character defining the unit of the saving dimension |
dpi |
numeric value defining plot resolution (dots per inch) |
The file name of the exported plot
Export a plot configuration as R code
exportPlotConfigurationCode(plotConfiguration, name = "plotConfiguration")exportPlotConfigurationCode(plotConfiguration, name = "plotConfiguration")
plotConfiguration |
A |
name |
Name of |
R code to recreate the plot configuration as character
List of all available units for width and height to export a ggplot object
ExportUnitsExportUnits
An object of class list of length 4.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class defining font properties
sizenumeric defining the size of font
colorcharacter defining the color of font
fontFamilycharacter defining the family of font
fontFacecharacter defining the font face as defined in helper enum FontFaces.
anglenumeric defining the angle of font
aligncharacter defining the alignment of font as defined in helper enum Alignments.
maxWidthnumeric that will be converted to a ggplot2::unit object (in "pt" unit) defining the maximum width of text box.
margina numeric vector of length 4 defining the size of the area (in pt) around the text in the followin order: top, right, bottom, left.
new()
Create a new Font object.
Default font properties are defined directly in the object field,
so NULL input is allowed will lead to default properties.
Font$new( color = NULL, size = NULL, fontFamily = NULL, fontFace = NULL, angle = NULL, align = NULL, maxWidth = NULL, margin = NULL )
colorcharacter defining the color of font.
sizenumeric defining the size of font.
fontFamilycharacter defining the family of font.
fontFacecharacter defining the font face as defined in helper enum FontFaces.
anglenumeric defining the angle of font.
aligncharacter defining the alignment of font as defined in helper enum Alignments.
maxWidthnumeric that will be converted to a ggplot2::unit object (in "pt" unit) defining the maximum width of text box.
margina numeric vector of length 4 defining the size of the area (in pt) around the text in the followin order: top, right, bottom, left.
A new Font object
createPlotTextFont()
Create a ggplot2::element_text directly convertible by ggplot2::theme.
Font$createPlotTextFont( size = NULL, color = NULL, fontFamily = NULL, fontFace = NULL, angle = NULL, align = NULL, margin = NULL )
sizenumeric defining the size of font
colorcharacter defining the color of font
fontFamilycharacter defining the family of font
fontFacecharacter defining the font face as defined in helper enum FontFaces.
anglenumeric defining the angle of font.
aligncharacter defining the alignment of font as defined in helper enum Alignments.
margina numeric vector of length 4 defining the size of the area (in pt) around the text in the followin order: top, right, bottom, left.
An element_text object.
createPlotTextBoxFont()
Create a ggplot2::element_text directly convertible by ggplot2::theme.
Font$createPlotTextBoxFont( size = NULL, color = NULL, fontFamily = NULL, fontFace = NULL, angle = NULL, align = NULL, maxWidth = NULL, margin = NULL )
sizenumeric defining the size of font
colorcharacter defining the color of font
fontFamilycharacter defining the family of font
fontFacecharacter defining the font face as defined in helper enum FontFaces.
anglenumeric defining the angle of font.
aligncharacter defining the alignment of font as defined in helper enum Alignments.
maxWidthnumeric that will be converted to a ggplot2::unit object (in "pt" unit) defining the maximum width of text box.
margina numeric vector of length 4 defining the size of the area (in pt) around the text in the followin order: top, right, bottom, left.
An ggtext::element_textbox object.
clone()
The objects of this class are cloneable with this method.
Font$clone(deep = FALSE)
deepWhether to make a deep clone.
List of all available font faces
FontFacesFontFaces
An object of class list of length 4.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
geom similar to geom_point() but that leverage fonts to draw its shapes
geomTLFPoint( mapping = NULL, data = NULL, stat = "identity", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ... )geomTLFPoint( mapping = NULL, data = NULL, stat = "identity", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ... )
mapping |
mapping from |
data |
data.frame |
stat |
stat name from |
position |
position name from |
na.rm |
a logical value indicating |
show.legend |
= NA, |
inherit.aes |
a logical value indicating if aesthetics are inherited |
... |
other arguments. |
Get a summary table of Box Whisker percentiles
getBoxWhiskerMeasure( data, dataMapping = NULL, y = NULL, group = NULL, quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95) )getBoxWhiskerMeasure( data, dataMapping = NULL, y = NULL, group = NULL, quantiles = c(0.05, 0.25, 0.5, 0.75, 0.95) )
data |
A data.frame to use for plot. |
dataMapping |
A |
y |
Name of |
group |
Name of grouping variable in |
quantiles |
Numeric values between 0 and 1 defining the quantiles to summarize |
A data.frame of summary statistics
# Get box-and-whisker plots of log-normal distributed data boxData <- data.frame(x = c(rep("A", 500), rep("B", 500)), y = rlnorm(1000)) getBoxWhiskerMeasure(data = boxData, dataMapping = BoxWhiskerDataMapping$new(x = "x", y = "y"))# Get box-and-whisker plots of log-normal distributed data boxData <- data.frame(x = c(rep("A", 500), rep("B", 500)), y = rlnorm(1000)) getBoxWhiskerMeasure(data = boxData, dataMapping = BoxWhiskerDataMapping$new(x = "x", y = "y"))
Creates default legend captions by concatenating the values of
the data and metaData of variableList variables from data.
getDefaultCaptions( data, metaData = NULL, variableList = colnames(data), sep = "-" )getDefaultCaptions( data, metaData = NULL, variableList = colnames(data), sep = "-" )
data |
data.frame used for legend caption |
metaData |
list of lists containing metaData on |
variableList |
ordered vector of variables used for specifying the caption |
sep |
characters separating variables in caption |
Factor levels corresponding to the legend captions
data <- data.frame( Population = c("Caucasian", "Asian", "Caucasian", "Asian"), Gender = c("Male", "Male", "Female", "Female"), Dose = c(50, 100, 100, 50), Compound = c("Midazolam", "Midazolam", "Midazolam", "Midazolam") ) metaData <- list(Dose = list(unit = "mg")) # Get captions using every variable of data getDefaultCaptions(data, metaData) # Get captions using specific variables of data getDefaultCaptions(data, metaData, variableList = c("Gender", "Population")) # Get captions separating variables witha space (character " ") getDefaultCaptions(data, metaData, sep = " ")data <- data.frame( Population = c("Caucasian", "Asian", "Caucasian", "Asian"), Gender = c("Male", "Male", "Female", "Female"), Dose = c(50, 100, 100, 50), Compound = c("Midazolam", "Midazolam", "Midazolam", "Midazolam") ) metaData <- list(Dose = list(unit = "mg")) # Get captions using every variable of data getDefaultCaptions(data, metaData) # Get captions using specific variables of data getDefaultCaptions(data, metaData, variableList = c("Gender", "Population")) # Get captions separating variables witha space (character " ") getDefaultCaptions(data, metaData, sep = " ")
Check if dual Y Axis is needed
getDualAxisPlot(leftPlotObject, rightPlotObject)getDualAxisPlot(leftPlotObject, rightPlotObject)
leftPlotObject |
A |
rightPlotObject |
A |
A ggplot object with dual y-axis
Get ticklabels expressions for discrete scale plots with greek letters
getGreekTickLabels(ticks)getGreekTickLabels(ticks)
ticks |
numeric values of the ticks |
Expressions to use in ticklabels input parameter of setXAxis and setYAxis functions
ticks <- c(1, 5, 10, 50, 100, 500) getGreekTickLabels(ticks)ticks <- c(1, 5, 10, 50, 100, 500) getGreekTickLabels(ticks)
Get a data.frame with Guest et al. ratio limits with:
ymax = x.limit
ymin = x/limit
limit = (delta+2(x-1))/x
getGuestValues(x, delta = 1, residualsVsObserved = FALSE)getGuestValues(x, delta = 1, residualsVsObserved = FALSE)
x |
Numeric values input of Guest function |
delta |
Numeric value parameter of Guest function |
residualsVsObserved |
Logical value defining if limits are calculated as residuals vs observed, instead of predicted vs observed. |
A data.frame with x, ymin and ymax defining Guest et al. limits
https://dmd.aspetjournals.org/content/39/2/170
# Get predicted vs observed Guest et al. limits getGuestValues(x = 10^seq(-2, 2, 0.2)) # Get residuals vs observed Guest et al. limits getGuestValues(x = 10^seq(-2, 2, 0.2), residualsVsObserved = TRUE)# Get predicted vs observed Guest et al. limits getGuestValues(x = 10^seq(-2, 2, 0.2)) # Get residuals vs observed Guest et al. limits getGuestValues(x = 10^seq(-2, 2, 0.2), residualsVsObserved = TRUE)
Get a data.frame with Guest et al. ratio limits from data and its DDIRatioDataMapping
getGuestValuesFromDataMapping(data, dataMapping)getGuestValuesFromDataMapping(data, dataMapping)
data |
A data.frame to use for plot. |
dataMapping |
A |
A data.frame with x, ymin and ymax defining Guest et al. limits
# Get the data.frame of Guest et al. limits ddiData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) getGuestValuesFromDataMapping( data = ddiData, dataMapping = DDIRatioDataMapping$new(x = "x", y = "y") )# Get the data.frame of Guest et al. limits ddiData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) getGuestValuesFromDataMapping( data = ddiData, dataMapping = DDIRatioDataMapping$new(x = "x", y = "y") )
Get label with its unit within square brackets when available
getLabelWithUnit(label, unit = NULL)getLabelWithUnit(label, unit = NULL)
label |
text of axis label |
unit |
Character value corresponding to unit of |
label [unit] or label depending if unit is NULL or ""
getLabelWithUnit("Time", "min") getLabelWithUnit("Label without unit")getLabelWithUnit("Time", "min") getLabelWithUnit("Label without unit")
Get the legend caption
getLegendCaption(plotObject)getLegendCaption(plotObject)
plotObject |
|
A data.frame corresponding to legend caption
Get the legend position
getLegendPosition(plotObject)getLegendPosition(plotObject)
plotObject |
|
Position of legend as defined in enum LegendPositions
LegendPositions
Get list of values to provide to lines argument of dataMapping objects.
The lines are internally used as argument of geom_hline and geom_abline from ggplot2
getLinesFromFoldDistance(foldDistance)getLinesFromFoldDistance(foldDistance)
foldDistance |
Numeric values
Caution: this argument is meant for log scaled plots and since fold distance is a ratio it is expected positive.
In particular, line of identity corresponds to a |
A list of numeric values
# Get lines for identity and 2-fold distance getLinesFromFoldDistance(c(1, 2)) # Create dataMapping with lines identity and 2-fold distance dataMapping <- ObsVsPredDataMapping$new( x = "predicted", y = "observed", lines = getLinesFromFoldDistance(c(1, 2)) )# Get lines for identity and 2-fold distance getLinesFromFoldDistance(c(1, 2)) # Create dataMapping with lines identity and 2-fold distance dataMapping <- ObsVsPredDataMapping$new( x = "predicted", y = "observed", lines = getLinesFromFoldDistance(c(1, 2)) )
Get ticklabels expressions for ln scale plots
getLnTickLabels(ticks)getLnTickLabels(ticks)
ticks |
numeric values of the ticks |
Expressions to use in ticklabels input parameter of setXAxis and setYAxis functions
ticks <- exp(c(1, 5, 10, 50, 100, 500)) getLnTickLabels(ticks)ticks <- exp(c(1, 5, 10, 50, 100, 500)) getLnTickLabels(ticks)
Get ticklabels expressions for log scale plots
getLogTickLabels(ticks)getLogTickLabels(ticks)
ticks |
numeric values of the ticks |
Expressions to use in ticklabels input parameter of setXAxis and setYAxis functions
ticks <- c(1, 5, 10, 50, 100, 500) getLogTickLabels(ticks)ticks <- c(1, 5, 10, 50, 100, 500) getLogTickLabels(ticks)
Get ticklabels expressions for percentiles of normal distribution scale plots
getPercentileTickLabels(ticks)getPercentileTickLabels(ticks)
ticks |
numeric values of the ticks |
Expressions to use in ticklabels input parameter of setXAxis and setYAxis functions
ticks <- rnorm(5) getPercentileTickLabels(ticks) # Get percentile of normal distribution ticks <- qnorm(seq(1, 9) / 10) getPercentileTickLabels(ticks)ticks <- rnorm(5) getPercentileTickLabels(ticks) # Get percentile of normal distribution ticks <- qnorm(seq(1, 9) / 10) getPercentileTickLabels(ticks)
Get ticklabels expressions for plots with values as ratios of Pi
getPiTickLabels(ticks)getPiTickLabels(ticks)
ticks |
numeric values of the ticks |
Expressions to use in ticklabels input parameter of setXAxis and setYAxis functions
ticks <- seq(0, 2 * pi, pi / 2) getPiTickLabels(ticks)ticks <- seq(0, 2 * pi, pi / 2) getPiTickLabels(ticks)
Get a summary table of PK Ratio within specific limits
getPKRatioMeasure(data, dataMapping = NULL, ratioLimits = c(1.5, 2))getPKRatioMeasure(data, dataMapping = NULL, ratioLimits = c(1.5, 2))
data |
A data.frame to use for plot. |
dataMapping |
A |
ratioLimits |
Numeric positive values limits |
A data.frame of summary of PK Ratio within specific limits
# Get summary of usual PK Ratio limits pkData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) getPKRatioMeasure(data = pkData, dataMapping = PKRatioDataMapping$new(x = "x", y = "y")) # Get summary of other PK Ratio limits getPKRatioMeasure( data = pkData, dataMapping = PKRatioDataMapping$new(x = "x", y = "y"), ratioLimits = seq(1.5, 5, 0.5) )# Get summary of usual PK Ratio limits pkData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) getPKRatioMeasure(data = pkData, dataMapping = PKRatioDataMapping$new(x = "x", y = "y")) # Get summary of other PK Ratio limits getPKRatioMeasure( data = pkData, dataMapping = PKRatioDataMapping$new(x = "x", y = "y"), ratioLimits = seq(1.5, 5, 0.5) )
Get same limits from multiple sets of values
getSameLimits(...)getSameLimits(...)
... |
numeric values |
An array of 2 values
getSameLimits(seq(-3, 8), seq(-12, 4))getSameLimits(seq(-3, 8), seq(-12, 4))
Get ticklabels expressions for sqrt scale plots
getSqrtTickLabels(ticks)getSqrtTickLabels(ticks)
ticks |
numeric values of the ticks |
Expressions to use in ticklabels input parameter of setXAxis and setYAxis functions
ticks <- sqrt(c(1, 5, 10, 50, 100, 500)) getSqrtTickLabels(ticks)ticks <- sqrt(c(1, 5, 10, 50, 100, 500)) getSqrtTickLabels(ticks)
Get symmetric limits from a set of values
getSymmetricLimits(values)getSymmetricLimits(values)
values |
numeric values |
An array of 2 symmetric values equally distant from 0
getSymmetricLimits(seq(-3, 8))getSymmetricLimits(seq(-3, 8))
Get Names of the default/global settings stored in tlfEnv.
Can be used with getTLFSettings()
getTLFSettings(settingName)getTLFSettings(settingName)
settingName |
setting name as defined in enum |
R6 class for mapping a group of variable(s) and their label to data
groupdata.frame or character defining the groups or group variables to group by
labelcharacter printed name of the grouping
new()
Create a new Grouping object
Grouping$new(group, label = NULL)
groupdata.frame or character vector of groups
labelcharacter name of the group
A new Grouping object
getCaptions()
Get the caption associated to each group
Grouping$getCaptions(data, metaData = NULL)
datadata.frame to map
metaDatalist of information on the data
A vector of characters containing the captions associated to each group of data
clone()
The objects of this class are cloneable with this method.
Grouping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class for mapping Grouping variables to data
colorR6 class Grouping object
fillR6 class Grouping object
linetypeR6 class Grouping object
shapeR6 class Grouping object
sizeR6 class Grouping object
new()
Create a new GroupMapping object
GroupMapping$new( color = NULL, fill = NULL, linetype = NULL, shape = NULL, size = NULL )
colorR6 class Grouping object or its input
fillR6 class Grouping object or its input
linetypeR6 class Grouping object or its input
shapeR6 class Grouping object or its input
sizeR6 class Grouping object or its input
A new GroupMapping object
clone()
The objects of this class are cloneable with this method.
GroupMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class for mapping x, bins, binwidth,stack and distribution to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> HistogramDataMapping
frequencylogical defining if histogram displays a frequency in y axis
stacklogical defining if histogram bars should be stacked
binsnumber of bins or binning values/methods passed on ggplot2::geom_histogram
binwidthwidth of bins passed on ggplot2::geom_histogram. Overwrites bins
distributionName of distribution to fit to the data.
Only 2 distributions are currently available: "normal" and "logNormal"
new()
Create a new HistogramDataMapping object
HistogramDataMapping$new( frequency = FALSE, stack = FALSE, bins = NULL, binwidth = NULL, distribution = NULL, ... )
frequencylogical defining if histogram displays a frequency in y axis
stacklogical defining if histogram bars should be stacked
binsargument passed on ggplot2::geom_histogram
binwidthwidth of bins passed on ggplot2::geom_histogram. Overwrites bins
distributionName of distribution to fit to the data.
Only 2 distributions are currently available: "normal" and "logNormal"
...parameters inherited from XYGDataMapping
A new HistogramDataMapping object
clone()
The objects of this class are cloneable with this method.
HistogramDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for histograms
tlf::PlotConfiguration -> HistogramPlotConfiguration
clone()
The objects of this class are cloneable with this method.
HistogramPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
List of all available horizontal justifications for plot annotation text.
HorizontalJustificationHorizontalJustification
An object of class list of length 3.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Initialize a ggplot object and set its labels, grid, background and watermark
initializePlot(plotConfiguration = NULL)initializePlot(plotConfiguration = NULL)
plotConfiguration |
An optional |
A ggplot graphical object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/atom-plots.html
Other atom plots:
addErrorbar(),
addLine(),
addRibbon(),
addScatter()
# Initialize an empty plot p <- initializePlot() # Implement a customized configuration using PlotConfiguration config <- PlotConfiguration$new(title = "My Plot", xlabel = "x variable", ylabel = "y variable") p <- initializePlot(config)# Initialize an empty plot p <- initializePlot() # Implement a customized configuration using PlotConfiguration config <- PlotConfiguration$new(title = "My Plot", xlabel = "x variable", ylabel = "y variable") p <- initializePlot(config)
Assess if x is between left and right bounds.
Shortcut for x >= left & x <= right if strict=FALSE (default).
Shortcut for x > left & x < right if strict=TRUE.
isBetween(x, left, right, strict = FALSE)isBetween(x, left, right, strict = FALSE)
x |
Numeric values to assess |
left |
Numeric value(s) used as lower bound |
right |
Numeric value(s) used as upper bound |
strict |
Logical value defining if |
Logical values
isBetween(1:12, 7, 9) x <- rnorm(1e2) x[isBetween(x, -1, 1)] isBetween(x, cos(x) + 1, cos(x) - 1)isBetween(1:12, 7, 9) x <- rnorm(1e2) x[isBetween(x, -1, 1)] isBetween(x, cos(x) + 1, cos(x) - 1)
R6 class defining text and font of labels
textcharacter text of the label
fontFont object
new()
Create a new Label object.
Label$new( text = "", font = NULL, color = NULL, size = NULL, fontFace = NULL, fontFamily = NULL, angle = NULL, align = NULL, maxWidth = NULL, margin = NULL )
textcharacter text of the label
fontFont object defining the font of the label
colorcharacter defining the color of the label
sizenumeric defining the size of the label
fontFacecharacter defining the font face of the label as defined in helper enum FontFaces.
fontFamilycharacter defining the font family of the label
anglenumeric defining the angle of the label.
aligncharacter defining the alignment of the label as defined in helper enum Alignments.
maxWidthnumeric that will be converted to a ggplot2::unit object (in "pt" unit) defining the maximum width of text box.
margina numeric vector of length 4 defining the size of the area (in pt) around the text in the followin order: top, right, bottom, left.
A new Label object
createPlotTextBoxFont()
Create a ggtext::element_textbox directly convertible by ggplot2::theme().
Label$createPlotTextBoxFont( color = NULL, size = NULL, fontFace = NULL, fontFamily = NULL, angle = NULL, align = NULL, maxWidth = NULL, margin = NULL )
colorcharacter defining the color of the label
sizenumeric defining the size of the label
fontFacecharacter defining the font face of the label as defined in helper enum FontFaces.
fontFamilycharacter defining the font family of the label
anglenumeric defining the angle of the label.
aligncharacter defining the alignment of the label as defined in helper enum Alignments.
maxWidthnumeric that will be converted to a ggplot2::unit object (in "pt" unit) defining the maximum width of text box.
margina numeric vector of length 4 defining the size of the area (in pt) around the text in the followin order: top, right, bottom, left.
An element_text or element_blankobject.
createPlotTextFont()
Create a ggplot2::element_text() directly convertible by ggplot2::theme().
Label$createPlotTextFont( color = NULL, size = NULL, fontFace = NULL, fontFamily = NULL, angle = NULL, align = NULL, margin = NULL )
colorcharacter defining the color of the label
sizenumeric defining the size of the label
fontFacecharacter defining the font face of the label as defined in helper enum FontFaces.
fontFamilycharacter defining the font family of the label
anglenumeric defining the angle of the label.
aligncharacter defining the alignment of the label as defined in helper enum Alignments.
margina numeric vector of length 4 defining the size of the area (in pt) around the text in the followin order: top, right, bottom, left.
An element_text or element_blankobject.
clone()
The objects of this class are cloneable with this method.
Label$clone(deep = FALSE)
deepWhether to make a deep clone.
R6 class defining the configuration of the labels of a ggplot object
titleLabel object defining the title of the plot
subtitleLabel object defining the subtitle of the plot
xlabelLabel object defining the xlabel of the plot
ylabelLabel object defining the ylabel of the plot
captionLabel object defining the caption of the plot
y2labelLabel object defining the y2label of the plot
new()
Create a new LabelConfiguration object
LabelConfiguration$new( title = NULL, subtitle = NULL, xlabel = NULL, ylabel = NULL, caption = NULL )
titlecharacter or Label object defining title
subtitlecharacter or Label object defining subtitle
xlabelcharacter or Label object defining xlabel
ylabelcharacter or Label object defining ylabel
captioncharacter or Label object defining caption
A new LabelConfiguration object
updatePlot()
Update labels of a ggplot object and their properties
LabelConfiguration$updatePlot(plotObject)
plotObjecta ggplot object
A ggplot object
clone()
The objects of this class are cloneable with this method.
LabelConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
R6 class defining the legend configuration of a ggplot object
captionof legend defined as data.frame with caption properties
positionof legend as defined in Enum LegendPositions
fontFont object defining the font of the legend
backgroundBackground object defining the background of the legend
titlecharacter defining title of the legend
new()
Create a new LegendConfiguration object
LegendConfiguration$new( position = NULL, caption = NULL, title = NULL, font = NULL, background = NULL )
positionposition of the legend as defined by enum LegendPositions
captiondata.frame containing the properties of the legend caption
titlecharacter or Label object defining the title of the legend. A value of NULL removes the title.
fontFont object defining the font of the legend caption
backgroundBackgroundElement object defining the background of the legend
A new LegendConfiguration object
updatePlot()
Update legend configuration on a ggplot object
LegendConfiguration$updatePlot(plotObject)
plotObjectggplot object
A ggplot object with updated axis properties
clone()
The objects of this class are cloneable with this method.
LegendConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
List of all available legend positions
LegendPositionsLegendPositions
An object of class list of length 17.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
List of all available legend types
LegendTypesLegendTypes
An object of class list of length 5.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class defining the properties of background line elements
tlf::BackgroundElement -> LineElement
createPlotElement()
Create a ggplot2::element_line directly usable by ggplot2::theme.
LineElement$createPlotElement(color = NULL, size = NULL, linetype = NULL)
colorcharacter color of the frame of the background element
sizecharacter size of the frame of the background element
linetypecharacter linetype of the frame of the background element
An element_line object.
clone()
The objects of this class are cloneable with this method.
LineElement$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
Enum of ggplot2 linetypes
LinetypesLinetypes
An object of class list of length 7.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
# Use ggplot2 to plot and label Linetypes linesData <- data.frame( x = 0, y = seq_along(Linetypes), linetype = factor(names(Linetypes), levels = names(Linetypes)) ) ggplot2::ggplot(data = linesData) + ggplot2::theme_void() + ggplot2::geom_hline(ggplot2::aes(yintercept = y, linetype = linetype)) + # Add linetype names from enum below the displayed linetype ggplot2::geom_text(ggplot2::aes(x = x, y = y, label = linetype), nudge_y = -0.2, size = 4) + # Use scale to display the actual linetype ggplot2::scale_linetype_manual(values = as.character(unlist(Linetypes))) + # Remove the legend as the linetype name is labelled below the linetype ggplot2::guides(linetype = "none") # Perform a line plot with blue long dashes as linetype addLine( x = 1:10, y = rlnorm(10), linetype = Linetypes$longdash, color = "blue", size = 1 )# Use ggplot2 to plot and label Linetypes linesData <- data.frame( x = 0, y = seq_along(Linetypes), linetype = factor(names(Linetypes), levels = names(Linetypes)) ) ggplot2::ggplot(data = linesData) + ggplot2::theme_void() + ggplot2::geom_hline(ggplot2::aes(yintercept = y, linetype = linetype)) + # Add linetype names from enum below the displayed linetype ggplot2::geom_text(ggplot2::aes(x = x, y = y, label = linetype), nudge_y = -0.2, size = 4) + # Use scale to display the actual linetype ggplot2::scale_linetype_manual(values = as.character(unlist(Linetypes))) + # Remove the legend as the linetype name is labelled below the linetype ggplot2::guides(linetype = "none") # Perform a line plot with blue long dashes as linetype addLine( x = 1:10, y = rlnorm(10), linetype = Linetypes$longdash, color = "blue", size = 1 )
Load theme object from json file. A template of a json theme is available at system.file(package= "tlf", "theme-maker","theme-template.json")
loadThemeFromJson(jsonFile)loadThemeFromJson(jsonFile)
jsonFile |
path of json file |
A Theme object
Load TLF global settings from a file
loadTLFSettings(file)loadTLFSettings(file)
file |
|
Calculate mean-1.96SD
`mean-1.96sd`(x)`mean-1.96sd`(x)
x |
Numeric values |
Numeric value corresponding to mean(x)-1.96*sd(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate mean-1.96SD `mean-1.96sd`(rnorm(1000))# Calculate mean-1.96SD `mean-1.96sd`(rnorm(1000))
Calculate mean-SD
`mean-sd`(x)`mean-sd`(x)
x |
Numeric values |
Numeric value corresponding to mean(x)-sd(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate mean-SD `mean-sd`(rnorm(1000))# Calculate mean-SD `mean-sd`(rnorm(1000))
Calculate mean+1.96SD
`mean+1.96sd`(x)`mean+1.96sd`(x)
x |
Numeric values |
Numeric value corresponding to mean(x)+1.96*sd(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate mean+1.96SD `mean+1.96sd`(rnorm(1000))# Calculate mean+1.96SD `mean+1.96sd`(rnorm(1000))
Calculate mean+SD
`mean+sd`(x)`mean+sd`(x)
x |
Numeric values |
Numeric value corresponding to mean(x)+sd(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate mean-SD `mean+sd`(rnorm(1000))# Calculate mean-SD `mean+sd`(rnorm(1000))
Calculate median-1.5IQR
`median-1.5IQR`(x)`median-1.5IQR`(x)
x |
Numeric values |
Numeric value corresponding to median(x)-1.5*iqr(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-IQR()
# Calculate median-1.5IQR `median-1.5IQR`(rnorm(1000))# Calculate median-1.5IQR `median-1.5IQR`(rnorm(1000))
Calculate median-IQR
`median-IQR`(x)`median-IQR`(x)
x |
Numeric values |
Numeric value corresponding to median(x)-iqr(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR()
# Calculate median-IQR `median-IQR`(rnorm(1000))# Calculate median-IQR `median-IQR`(rnorm(1000))
Calculate median+1.5IQR
`median+1.5IQR`(x)`median+1.5IQR`(x)
x |
Numeric values |
Numeric value corresponding to median(x)+1.5*iqr(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate median+1.5IQR `median+1.5IQR`(rnorm(1000))# Calculate median+1.5IQR `median+1.5IQR`(rnorm(1000))
Calculate median+IQR
`median+IQR`(x)`median+IQR`(x)
x |
Numeric values |
Numeric value corresponding to median(x)+iqr(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median-1.5IQR(),
median-IQR()
# Calculate median+IQR `median+IQR`(rnorm(1000))# Calculate median+IQR `median+IQR`(rnorm(1000))
List of all available molecule plots
MoleculePlotsMoleculePlots
An object of class list of length 15.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class for mapping x, y, of observed data for a time profile plot
tlf::XYDataMapping -> tlf::XYGDataMapping -> ObservedDataMapping
errormapping error bars around scatter points
mdvmapping missing dependent variable
yminmapping error bars around scatter points
ymaxmapping error bars around scatter points
y2AxisName of y2Axis variable to map
lloqmapping lloq lines
new()
Create a new ObservedDataMapping object
ObservedDataMapping$new( x, y, ymin = NULL, ymax = NULL, y2Axis = NULL, group = NULL, color = NULL, shape = NULL, error = NULL, uncertainty = lifecycle::deprecated(), mdv = NULL, data = NULL, lloq = NULL )
xName of x variable to map
yName of y variable to map
yminmapping lower end of error bars around scatter points
ymaxmapping upper end of error bars around scatter points
y2AxisName of y2Axis variable to map
groupR6 class Grouping object or its input
colorR6 class Grouping object or its input
shapeR6 class Grouping object or its input
errormapping error bars around scatter points
uncertainty uncertainty were
replaced by
error argument. Mapping error bars around scatter points.
mdvmapping missing dependent variable
datadata.frame to map used by .smartMapping
lloqmapping lloq lines
A new ObservedDataMapping object
checkMapData()
Check that data variables include map variables
ObservedDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and defaultAes variables.
Dummy variable defaultAes is necessary to allow further modification of plots.
requireDualAxis()
Assess if data require a dual axis plot
ObservedDataMapping$requireDualAxis(data)
datadata.frame to check
A logical
getLeftAxis()
Render NA values for all right axis data
ObservedDataMapping$getLeftAxis(data)
dataA data.frame
A data.frame to be plotted in left axis
getRightAxis()
Render NA values for all left axis data
ObservedDataMapping$getRightAxis(data)
dataA data.frame
A data.frame to be plotted in right axis
clone()
The objects of this class are cloneable with this method.
ObservedDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
Class for mapping variables in observations vs predictions plot
tlf::XYDataMapping -> tlf::XYGDataMapping -> ObsVsPredDataMapping
lineslist of ratio limits to plot as horizontal lines
xminmapping of upper value of error bars around scatter points
xmaxmapping of lower value of error bars around scatter points
smootherregression function name
lloqmapping lloq lines
new()
Create a new ObsVsPredDataMapping object
ObsVsPredDataMapping$new( x = NULL, y = NULL, xmin = NULL, xmax = NULL, lines = DefaultDataMappingValues$obsVsPred, smoother = NULL, lloq = NULL, ... )
xName of x variable to map
yName of y variable to map
xminmapping of upper value of error bars around scatter points
xmaxmapping of lower value of error bars around scatter points
lineslist of lines to plot
smoothersmoother function or parameter
lloqmapping lloq lines
To map a loess smoother to the plot, use smoother="loess"
...parameters inherited from XYGDataMapping
A new ObsVsPredDataMapping object
checkMapData()
Check that data variables include map variables
ObsVsPredDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and defaultAes variables.
Dummy variable defaultAes is necessary to allow further modification of plots.
clone()
The objects of this class are cloneable with this method.
ObsVsPredDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for Obs vs Pred plots
tlf::PlotConfiguration -> ObsVsPredPlotConfiguration
defaultSymmetricAxesDefault option setting symmetric xAxis and/or yAxis limits when creating a ObsVsPredPlotConfiguration object
lloqDirectionWhether to draw LLOQ lines for x (vertical), y (horizontal) or x and y (both).
foldLinesLegendWhether to draw fold lines in legend. default to FALSE.
foldLinesLegendDiagonalWhether to draw diagonal lines in legend for fold lines. default to FALSE.
foldLineslegendTypetranslation of foldLinesLegendDiagonal in geom type.
new()
Create a new ObsVsPredPlotConfiguration object
ObsVsPredPlotConfiguration$new( lloqDirection = "vertical", foldLinesLegend = FALSE, foldLinesLegendDiagonal = FALSE, ... )
lloqDirectionWhether to draw LLOQ lines for x (vertical), y (horizontal) or x and y (both).
foldLinesLegendWhether to draw fold lines in legend. default to FALSE.
foldLinesLegendDiagonalWhether to draw diagonal lines in legend for fold lines. default to FALSE.
...parameters inherited from PlotConfiguration
A new CumulativeTimeProfilePlotConfiguration object
clone()
The objects of this class are cloneable with this method.
ObsVsPredPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
Calculate Percentile0% i.e. min value
`Percentile0%`(x)`Percentile0%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 0)
Other stat functions:
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile0% `Percentile0%`(rnorm(1000))# Calculate Percentile0% `Percentile0%`(rnorm(1000))
Calculate Percentile1%
`Percentile1%`(x)`Percentile1%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 1/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile1% `Percentile1%`(rnorm(1000))# Calculate Percentile1% `Percentile1%`(rnorm(1000))
Calculate Percentile10%
`Percentile10%`(x)`Percentile10%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 10/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile10% `Percentile10%`(rnorm(1000))# Calculate Percentile10% `Percentile10%`(rnorm(1000))
Calculate Percentile100% i.e. max value
`Percentile100%`(x)`Percentile100%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 1)
Other stat functions:
Percentile0%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile100% `Percentile100%`(rnorm(1000))# Calculate Percentile100% `Percentile100%`(rnorm(1000))
Calculate Percentile15%
`Percentile15%`(x)`Percentile15%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 15/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile15% `Percentile15%`(rnorm(1000))# Calculate Percentile15% `Percentile15%`(rnorm(1000))
Calculate Percentile2.5%
`Percentile2.5%`(x)`Percentile2.5%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 2.5/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile2.5% `Percentile2.5%`(rnorm(1000))# Calculate Percentile2.5% `Percentile2.5%`(rnorm(1000))
Calculate Percentile20%
`Percentile20%`(x)`Percentile20%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 20/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile20% `Percentile20%`(rnorm(1000))# Calculate Percentile20% `Percentile20%`(rnorm(1000))
Calculate Percentile25% i.e. 1st quartile value
`Percentile25%`(x)`Percentile25%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 25/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile25% `Percentile25%`(rnorm(1000))# Calculate Percentile25% `Percentile25%`(rnorm(1000))
Calculate Percentile25%-1.5IQR
`Percentile25%-1.5IQR`(x)`Percentile25%-1.5IQR`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 0.25)-1.5*iqr(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile25%-1.5IQR `Percentile25%-1.5IQR`(rnorm(1000))# Calculate Percentile25%-1.5IQR `Percentile25%-1.5IQR`(rnorm(1000))
Calculate Percentile5%
`Percentile5%`(x)`Percentile5%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 5/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile5% `Percentile5%`(rnorm(1000))# Calculate Percentile5% `Percentile5%`(rnorm(1000))
Calculate Percentile50% i.e. median value
`Percentile50%`(x)`Percentile50%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 50/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile50% `Percentile50%`(rnorm(1000))# Calculate Percentile50% `Percentile50%`(rnorm(1000))
Calculate Percentile75% i.e. 3rd quartile value
`Percentile75%`(x)`Percentile75%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 75/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile75% `Percentile75%`(rnorm(1000))# Calculate Percentile75% `Percentile75%`(rnorm(1000))
Calculate Percentile75%+1.5IQR
`Percentile75%+1.5IQR`(x)`Percentile75%+1.5IQR`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 0.75)+1.5*iqr(x)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile75%+1.5IQR `Percentile75%+1.5IQR`(rnorm(1000))# Calculate Percentile75%+1.5IQR `Percentile75%+1.5IQR`(rnorm(1000))
Calculate Percentile80%
`Percentile80%`(x)`Percentile80%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 80/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile80% `Percentile80%`(rnorm(1000))# Calculate Percentile80% `Percentile80%`(rnorm(1000))
Calculate Percentile85%
`Percentile85%`(x)`Percentile85%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 85/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile85% `Percentile85%`(rnorm(1000))# Calculate Percentile85% `Percentile85%`(rnorm(1000))
Calculate Percentile90%
`Percentile90%`(x)`Percentile90%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 90/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile95%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile90% `Percentile90%`(rnorm(1000))# Calculate Percentile90% `Percentile90%`(rnorm(1000))
Calculate Percentile95%
`Percentile95%`(x)`Percentile95%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 95/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile97.5%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile95% `Percentile95%`(rnorm(1000))# Calculate Percentile95% `Percentile95%`(rnorm(1000))
Calculate Percentile97.5%
`Percentile97.5%`(x)`Percentile97.5%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 97.5/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile99%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile97.5% `Percentile97.5%`(rnorm(1000))# Calculate Percentile97.5% `Percentile97.5%`(rnorm(1000))
Calculate Percentile99%
`Percentile99%`(x)`Percentile99%`(x)
x |
Numeric values |
Numeric value corresponding to quantile(x, 99/100)
Other stat functions:
Percentile0%(),
Percentile100%(),
Percentile10%(),
Percentile15%(),
Percentile1%(),
Percentile2.5%(),
Percentile20%(),
Percentile25%(),
Percentile25%-1.5IQR(),
Percentile50%(),
Percentile5%(),
Percentile75%(),
Percentile75%+1.5IQR(),
Percentile80%(),
Percentile85%(),
Percentile90%(),
Percentile95%(),
Percentile97.5%(),
mean+1.96sd(),
mean+sd(),
mean-1.96sd(),
mean-sd(),
median+1.5IQR(),
median+IQR(),
median-1.5IQR(),
median-IQR()
# Calculate Percentile99% `Percentile99%`(rnorm(1000))# Calculate Percentile99% `Percentile99%`(rnorm(1000))
R6 class for mapping x, y, and group to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> PieChartDataMapping
clone()
The objects of this class are cloneable with this method.
PieChartDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for pie charts
tlf::PlotConfiguration -> PieChartPlotConfiguration
colorPalettecolor palette property from ggplot2
chartFontFont object defining properties of text within pie chart
startOffset of starting point from 12 o'clock in radians. Offset is applied clockwise or anticlockwise depending on value of direction
clockwiseDirectionlogical defining if values are displayed in clockwise order
new()
Create a new PieChartPlotConfiguration object
PieChartPlotConfiguration$new( colorPalette = NULL, chartFont = NULL, start = 0, clockwiseDirection = TRUE, ... )
colorPalettecolor palette property from ggplot2
chartFontFont object defining properties of text within pie chart
startOffset of starting point from 12 o'clock in radians. Offset is applied clockwise or anticlockwise depending on value of direction
clockwiseDirectionlogical defining if values are displayed in clockwise order
...parameters inherited from PlotConfiguration
A new PieChartPlotConfiguration object
clone()
The objects of this class are cloneable with this method.
PieChartPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
R6 class for mapping x, y, GroupMapping and pkRatio lines variables to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> PKRatioDataMapping
lineslist of ratio limits to plot as horizontal lines
yminmapping of upper value of error bars around scatter points
ymaxmapping of lower value of error bars around scatter points
new()
Create a new PKRatioDataMapping object
PKRatioDataMapping$new( x = NULL, y = NULL, ymin = NULL, ymax = NULL, lines = DefaultDataMappingValues$pkRatio, ... )
xName of x variable to map
yName of y variable to map
yminmapping of upper value of error bars around scatter points
ymaxmapping of lower value of error bars around scatter points
linesList of ratio limits to display as horizontal lines
...parameters inherited from XYGDataMapping
A new PKRatioDataMapping object
checkMapData()
Check that data variables include map variables
PKRatioDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and defaultAes variables.
Dummy variable defaultAes is necessary to allow further modification of plots.
clone()
The objects of this class are cloneable with this method.
PKRatioDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for PK ratio plots
tlf::PlotConfiguration -> PKRatioPlotConfiguration
defaultYScaleDefault yAxis scale value when creating a PKRatioPlotConfiguration object
clone()
The objects of this class are cloneable with this method.
PKRatioPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
List of default text sizes for plot annotations.
PlotAnnotationTextSizePlotAnnotationTextSize
An object of class list of length 12.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Producing box-and-whisker plots
plotBoxWhisker( data, metaData = NULL, outliers = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )plotBoxWhisker( data, metaData = NULL, outliers = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
outliers |
Logical defining if outliers should be included in boxplot |
dataMapping |
A |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/box-whisker-vignette.html
Other molecule plots:
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce box-and-whisker plots of log-normal distributed data boxData <- data.frame(x = c(rep("A", 500), rep("B", 500)), y = rlnorm(1000)) plotBoxWhisker(data = boxData, dataMapping = BoxWhiskerDataMapping$new(x = "x", y = "y")) # Remove outliers from boxplot plotBoxWhisker( data = boxData, dataMapping = BoxWhiskerDataMapping$new(x = "x", y = "y"), outliers = FALSE )# Produce box-and-whisker plots of log-normal distributed data boxData <- data.frame(x = c(rep("A", 500), rep("B", 500)), y = rlnorm(1000)) plotBoxWhisker(data = boxData, dataMapping = BoxWhiskerDataMapping$new(x = "x", y = "y")) # Remove outliers from boxplot plotBoxWhisker( data = boxData, dataMapping = BoxWhiskerDataMapping$new(x = "x", y = "y"), outliers = FALSE )
R6 class defining the configuration of a ggplot object
exportR6 class ExportConfiguration defining properties for saving/exporting plot
defaultXScaleDefault xAxis scale value when creating a PlotConfiguration object
defaultYScaleDefault yAxis scale value when creating a PlotConfiguration object
defaultExpandDefault expand value when creating a PlotConfiguration object
defaultSymmetricAxesDefault option setting symmetric xAxis and/or yAxis limits when creating a PlotConfiguration object
labelsLabelConfiguration object defining properties of labels
legendLegendConfiguration object defining properties of legend
xAxisXAxisConfiguration object defining properties of x-axis
yAxisYAxisConfiguration object defining properties of x-axis
backgroundBackgroundConfiguration object defining properties of x-axis
linesThemeAestheticSelections defining properties of lines
ribbonsThemeAestheticSelections defining properties of ribbons
pointsThemeAestheticSelections defining properties of points
errorbarsThemeAestheticSelections defining properties of error bars
new()
Create a new PlotConfiguration object
PlotConfiguration$new( title = NULL, subtitle = NULL, xlabel = NULL, ylabel = NULL, caption = NULL, legend = NULL, legendTitle = NULL, legendPosition = NULL, xAxis = NULL, xScale = NULL, xValuesLimits = NULL, xAxisLimits = NULL, xLimits = lifecycle::deprecated(), yAxis = NULL, yScale = NULL, yValuesLimits = NULL, yAxisLimits = NULL, yLimits = lifecycle::deprecated(), background = NULL, plotArea = NULL, panelArea = NULL, xGrid = NULL, yGrid = NULL, watermark = NULL, lines = NULL, points = NULL, ribbons = NULL, errorbars = NULL, export = NULL, name = NULL, format = NULL, width = NULL, height = NULL, units = NULL, dpi = NULL, data = NULL, metaData = NULL, dataMapping = NULL )
titlecharacter or Label object defining plot title
subtitlecharacter or Label object defining plot subtitle
xlabelcharacter or Label object defining plot xlabel
ylabelcharacter or Label object defining plot ylabel
captioncharacter or Label object defining plot caption
legendLegendConfiguration object defining legend properties
legendTitlecharacter or Label object defining legend title
legendPositioncharacter defining legend position.
Use Enum LegendPositions to get a list of available to legend positions.
xAxisXAxisConfiguration object defining x-axis properties
xScalename of X-axis scale. Use enum Scaling to access predefined scales.
xValuesLimitsnumeric vector of length 2 defining x values limits
xAxisLimitsnumeric vector of length 2 defining x-axis limits
xLimitsyAxisYAxisConfiguration object defining y-axis properties
yScalename of y-axis scale. Use enum Scaling to access predefined scales.
yValuesLimitsnumeric vector of length 2 defining x values limits
yAxisLimitsnumeric vector of length 2 defining x-axis limits
yLimitsbackgroundBackgroundConfiguration object defining background properties
plotAreaBackgroundElement object defining properties of plot area
panelAreaBackgroundElement object defining properties of panel area
xGridLineElement object defining properties of x-grid background
yGridLineElement object defining properties of y-grid background
watermarkcharacter or Label object defining watermark
linesThemeAestheticSelections object or list defining how lines are plotted
pointsThemeAestheticSelections object or list defining how points are plotted
ribbonsThemeAestheticSelections object or list defining how ribbons are plotted
errorbarsThemeAestheticSelections object or list defining how errorbars are plotted
exportR6 class ExportConfiguration defining properties for saving/exporting plot
namecharacter defining the name of the file to be saved (without extension)
formatcharacter defining the format of the file to be saved.
widthnumeric values defining the width in units of the plot dimensions after saving
heightnumeric values defining the height in units of the plot dimensions after saving
unitscharacter defining the unit of the saving dimension
dpinumeric value defining plot resolution (dots per inch)
datadata.frame used by .smartMapping
metaDatalist of information on data
dataMappingR6 class or subclass XYDataMapping
A new PlotConfiguration object
clone()
The objects of this class are cloneable with this method.
PlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/plot-configuration.html
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
List of all available molecule plots
PlotConfigurationsPlotConfigurations
An object of class list of length 23.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
Producing Cumulative Time Profile plots
plotCumulativeTimeProfile( data = NULL, metaData = NULL, dataMapping = NULL, colorPalette = NULL, plotConfiguration = NULL, plotObject = NULL )plotCumulativeTimeProfile( data = NULL, metaData = NULL, dataMapping = NULL, colorPalette = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
colorPalette |
Optional character values defining a |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Define data to be plotted as cumulative time profile time <- seq(1, 10) data <- data.frame( x = rep(time), y = c(exp(-time / 10), 1 - exp(-time / 10)), legend = rep(c("decreasing area", "increasing area"), each = 10) ) # Produce a Cumulative Time Profile plot plotCumulativeTimeProfile( data = data, dataMapping = CumulativeTimeProfileDataMapping$new(x = "x", y = "y", fill = "legend") ) # Produce a Cumulative Time Profile plot with a ggplot2 color palette plotCumulativeTimeProfile( data = data, dataMapping = CumulativeTimeProfileDataMapping$new( x = "x", y = "y", fill = "legend" ), colorPalette = "Set1" )# Define data to be plotted as cumulative time profile time <- seq(1, 10) data <- data.frame( x = rep(time), y = c(exp(-time / 10), 1 - exp(-time / 10)), legend = rep(c("decreasing area", "increasing area"), each = 10) ) # Produce a Cumulative Time Profile plot plotCumulativeTimeProfile( data = data, dataMapping = CumulativeTimeProfileDataMapping$new(x = "x", y = "y", fill = "legend") ) # Produce a Cumulative Time Profile plot with a ggplot2 color palette plotCumulativeTimeProfile( data = data, dataMapping = CumulativeTimeProfileDataMapping$new( x = "x", y = "y", fill = "legend" ), colorPalette = "Set1" )
Producing DDI Ratio plots
plotDDIRatio( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, residualsVsObserved = NULL, foldDistance = NULL, deltaGuest = NULL, plotObject = NULL )plotDDIRatio( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, residualsVsObserved = NULL, foldDistance = NULL, deltaGuest = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
plotConfiguration |
An optional |
residualsVsObserved |
Optional logical value defining if DDI Ratio plot is drawn as residuals vs observed, instead of predicted vs observed. |
foldDistance |
Numeric values of fold distance lines to display in log plots.
This argument is internally translated into |
deltaGuest |
Numeric value parameter of Guest function |
plotObject |
An optional |
A ggplot object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/pk-ratio-vignette.html
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce DDI Ratio plot ddiData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotDDIRatio(data = ddiData, dataMapping = DDIRatioDataMapping$new(x = "x", y = "y")) # Produce DDI Ratio plot with user-defined horizontal lines plotDDIRatio( data = ddiData, dataMapping = DDIRatioDataMapping$new(x = "x", y = "y"), foldDistance = c(1, 10), deltaGuest = 1.25, residualsVsObserved = TRUE )# Produce DDI Ratio plot ddiData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotDDIRatio(data = ddiData, dataMapping = DDIRatioDataMapping$new(x = "x", y = "y")) # Produce DDI Ratio plot with user-defined horizontal lines plotDDIRatio( data = ddiData, dataMapping = DDIRatioDataMapping$new(x = "x", y = "y"), foldDistance = c(1, 10), deltaGuest = 1.25, residualsVsObserved = TRUE )
Create a plot grid using the patchwork::wrap_plots() function. The required
arguments are supplied through the PlotGridConfiguration object.
plotGrid(plotGridConfiguration)plotGrid(plotGridConfiguration)
plotGridConfiguration |
A |
For more, see: https://patchwork.data-imaginist.com/articles/patchwork.html
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
library(ggplot2) library(tlf) # only `{tlf}` --------------------- # plots to be arranged in a grid set.seed(123) ls_plots <- list( plotHistogram(x = rnorm(100)), plotHistogram(x = rnorm(100, mean = 3)), plotHistogram(x = rnorm(100, mean = 10)) ) # create an instance of plot configuration class plotGridObj <- PlotGridConfiguration$new(plotList = ls_plots) # specify further customizations for the plot grid plotGridObj$title <- "my combined plot" plotGridObj$subtitle <- "something clever" plotGridObj$caption <- "my sources" plotGridObj$nColumns <- 2L plotGridObj$tagLevels <- "A" plotGridObj$tagPrefix <- "Plot (" plotGridObj$tagSuffix <- ")" plotGridObj$tagColor <- "blue" plotGridObj$tagSize <- 15 plotGridObj$tagAngle <- 45 plotGridObj$tagPosition <- TagPositions$top plotGridObj$titleHorizontalJustification <- HorizontalJustification$middle plotGridObj$subtitleHorizontalJustification <- HorizontalJustification$middle # plot the grid plotGrid(plotGridObj) # `{tlf}` and `{ggplot2}` --------------------- # `{tlf}` plot set.seed(123) p1 <- plotBoxWhisker(mtcars, dataMapping = BoxWhiskerDataMapping$new(x = "am", y = "wt"), outliers = FALSE ) # custom `{ggplot2}` plot set.seed(123) p2 <- ggplot(mtcars, aes(wt, mpg)) + geom_point() # create an instance of plot configuration class plotGridObj2 <- PlotGridConfiguration$new(list(p1, p2)) # specify further customizations for the plot grid plotGridObj2$nColumns <- 1L plotGridObj2$tagLevels <- "i" # plot the grid plotGrid(plotGridObj2)library(ggplot2) library(tlf) # only `{tlf}` --------------------- # plots to be arranged in a grid set.seed(123) ls_plots <- list( plotHistogram(x = rnorm(100)), plotHistogram(x = rnorm(100, mean = 3)), plotHistogram(x = rnorm(100, mean = 10)) ) # create an instance of plot configuration class plotGridObj <- PlotGridConfiguration$new(plotList = ls_plots) # specify further customizations for the plot grid plotGridObj$title <- "my combined plot" plotGridObj$subtitle <- "something clever" plotGridObj$caption <- "my sources" plotGridObj$nColumns <- 2L plotGridObj$tagLevels <- "A" plotGridObj$tagPrefix <- "Plot (" plotGridObj$tagSuffix <- ")" plotGridObj$tagColor <- "blue" plotGridObj$tagSize <- 15 plotGridObj$tagAngle <- 45 plotGridObj$tagPosition <- TagPositions$top plotGridObj$titleHorizontalJustification <- HorizontalJustification$middle plotGridObj$subtitleHorizontalJustification <- HorizontalJustification$middle # plot the grid plotGrid(plotGridObj) # `{tlf}` and `{ggplot2}` --------------------- # `{tlf}` plot set.seed(123) p1 <- plotBoxWhisker(mtcars, dataMapping = BoxWhiskerDataMapping$new(x = "am", y = "wt"), outliers = FALSE ) # custom `{ggplot2}` plot set.seed(123) p2 <- ggplot(mtcars, aes(wt, mpg)) + geom_point() # create an instance of plot configuration class plotGridObj2 <- PlotGridConfiguration$new(list(p1, p2)) # specify further customizations for the plot grid plotGridObj2$nColumns <- 1L plotGridObj2$tagLevels <- "i" # plot the grid plotGrid(plotGridObj2)
An R6 class defining the configuration for {patchwork} plot grid used to
create a grid of plots from {tlf}. It holds values for all relevant
plot properties.
A PlotGridConfiguration object.
You can change the default values present in public fields.
For example, if you want to specify a new position for tags, you will have to do the following:
myPlotGridConfiguration <- PlotGridConfiguration$new() myPlotGridConfiguration$tagPosition <- TagPositions$right
For more, see examples.
A font is a particular set of glyphs (character shapes), differentiated from other fonts in the same family by additional properties such as stroke weight, slant, relative width, etc.
A font face (aka typeface) is the design of lettering, characterized by
variations in size, weight (e.g. bold), slope (e.g. italic), width (e.g.
condensed), and so on. The available font faces can seen using
FontFaces list.
A font family is a grouping of fonts defined by shared design styles.
The available font families will depend on which fonts have been installed on your computer. This information can be extracted by running the following code:
# install.packages("systemfonts")
library(systemfonts)
system_fonts()
By default, the plots will be shown in plot pane of your IDE, but the plots
can also be saved to a file using the ggplot2::ggsave() function.
myPlot <- plotGrid(...) ggplot2::ggsave(filename = "plot_1.png", plot = myPlot)
ospsuite.utils::Printable -> PlotGridConfiguration
plotListA list containing ggplot objects.
title, subtitle, captionText strings to use for the various plot annotations, where plot refers to the grid of plots as a whole.
titleColor, titleSize, titleFontFace, titleFontFamily, titleHorizontalJustification, titleVerticalJustification, titleAngle, titleMarginAesthetic properties for the plot title.
subtitleColor, subtitleSize, subtitleFontFace, subtitleFontFamily, subtitleHorizontalJustification, subtitleVerticalJustification, subtitleAngle, subtitleMarginAesthetic properties for the plot subtitle.
captionColor, captionSize, captionFontFace, captionFontFamily, captionHorizontalJustification, captionVerticalJustification, captionAngle, captionMarginAesthetic properties for the plot caption.
tagLevelsA character vector defining the enumeration format to use
at each level. Possible values are 'a' for lowercase letters, 'A' for
uppercase letters, '1' for numbers, 'i' for lowercase Roman numerals, and
'I' for uppercase Roman numerals. It can also be a list containing
character vectors defining arbitrary tag sequences. If any element in the
list is a scalar and one of 'a', 'A', '1', 'i, or 'I', this level
will be expanded to the expected sequence.
tagPrefix, tagSuffixStrings that should appear before or after the tag.
tagSeparatorA separator between different tag levels.
tagPositionPosition of the tag for an individual plot with respect to
that plot. Default is topleft. For all available options, see
TagPositions.
tagColor, tagSize, tagFontFamily, tagFontFace, tagHorizontalJustification, tagVerticalJustification, tagAngle, tagLineHeight, tagMarginAesthetic properties of individual plot tag text. For more detailed description of each aesthetic property, see docs for element_text().
nColumns, nRowsThe dimensions of the grid to create - if both are
NULL it will use the same logic as facet_wrap() to
set the dimensions
byRowAnalogous to byrow in matrix(). If FALSE the
plots will be filled in in column-major order.
widths, heightsThe relative widths and heights of each column and row in the grid. Will get repeated to match the dimensions of the grid.
guidesA string specifying how guides should be treated in the layout.
'collect' will collect guides below to the given nesting level, removing
duplicates. 'keep' will stop collection at this level and let guides be
placed alongside their plot. auto will allow guides to be collected if a
upper level tries, but place them alongside the plot if not. If you modify
default guide "position" with theme(legend.position=...)
while also collecting guides you must apply that change to the overall
patchwork.
designSpecification of the location of areas in the layout. Can
either be specified as a text string or by concatenating calls to patchwork::area()
together. See the examples in wrap_plots() for
further information on use.
title, subtitle, captionText strings to use for the various plot annotations, where plot refers to the grid of plots as a whole.
titleColor, titleSize, titleFontFace, titleFontFamily, titleHorizontalJustification, titleVerticalJustification, titleAngle, titleMarginAesthetic properties for the plot title.
subtitleColor, subtitleSize, subtitleFontFace, subtitleFontFamily, subtitleHorizontalJustification, subtitleVerticalJustification, subtitleAngle, subtitleMarginAesthetic properties for the plot subtitle.
captionColor, captionSize, captionFontFace, captionFontFamily, captionHorizontalJustification, captionVerticalJustification, captionAngle, captionMarginAesthetic properties for the plot caption.
tagPrefix, tagSuffixStrings that should appear before or after the tag.
tagColor, tagSize, tagFontFamily, tagFontFace, tagHorizontalJustification, tagVerticalJustification, tagAngle, tagLineHeight, tagMarginAesthetic properties of individual plot tag text. For more detailed description of each aesthetic property, see docs for element_text().
nColumns, nRowsThe dimensions of the grid to create - if both are
NULL it will use the same logic as facet_wrap() to
set the dimensions
widths, heightsThe relative widths and heights of each column and row in the grid. Will get repeated to match the dimensions of the grid.
new()
Create an instance of PlotGridConfiguration class.
PlotGridConfiguration$new(plotList = NULL)
plotListA list containing ggplot objects.
A PlotGridConfiguration object.
addPlots()
Add a plot object.
PlotGridConfiguration$addPlots(plots = NULL)
plotsA single or a list containing ggplot object(s).
PlotGridConfiguration object with $plotList field updated to
store entered plots.
library(ggplot2)
myPlotGrid <- PlotGridConfiguration$new()
# You can add a single ggplot object
p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
myPlotGrid$addPlots(p)
# Or you can also pass a list
myPlotGrid$addPlots(list("p1" = ggplot(), "p2" = ggplot()))
# Since we added three plots, the `plotList` field should
# now be a list of length `3`
length(myPlotGrid$plotList)
print()
Print the object to the console.
PlotGridConfiguration$print()
clone()
The objects of this class are cloneable with this method.
PlotGridConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
library(tlf) # create a list of plots ls_plots <- list( # first plot plotBoxWhisker(mtcars, dataMapping = BoxWhiskerDataMapping$new(x = "am", y = "wt"), outliers = FALSE ), # second plot plotBoxWhisker(ToothGrowth, dataMapping = BoxWhiskerDataMapping$new(x = "supp", y = "len") ) ) plotGridObj <- PlotGridConfiguration$new(ls_plots) # specify further customizations for the plot grid plotGridObj$title <- "my combined plot" plotGridObj$subtitle <- "something clever" plotGridObj$caption <- "my sources" plotGridObj$nColumns <- 2L plotGridObj$tagLevels <- "A" plotGridObj$tagPrefix <- "Plot (" plotGridObj$tagSuffix <- ")" plotGridObj$tagColor <- "blue" plotGridObj$tagSize <- 15 plotGridObj$tagAngle <- 45 plotGridObj$tagPosition <- TagPositions$top plotGridObj$titleHorizontalJustification <- HorizontalJustification$middle plotGridObj$subtitleHorizontalJustification <- HorizontalJustification$middle # print the object to see its properties plotGridObj ## ------------------------------------------------ ## Method `PlotGridConfiguration$addPlots` ## ------------------------------------------------ library(ggplot2) myPlotGrid <- PlotGridConfiguration$new() # You can add a single ggplot object p <- ggplot(mtcars, aes(wt, mpg)) + geom_point() myPlotGrid$addPlots(p) # Or you can also pass a list myPlotGrid$addPlots(list("p1" = ggplot(), "p2" = ggplot())) # Since we added three plots, the `plotList` field should # now be a list of length `3` length(myPlotGrid$plotList)library(tlf) # create a list of plots ls_plots <- list( # first plot plotBoxWhisker(mtcars, dataMapping = BoxWhiskerDataMapping$new(x = "am", y = "wt"), outliers = FALSE ), # second plot plotBoxWhisker(ToothGrowth, dataMapping = BoxWhiskerDataMapping$new(x = "supp", y = "len") ) ) plotGridObj <- PlotGridConfiguration$new(ls_plots) # specify further customizations for the plot grid plotGridObj$title <- "my combined plot" plotGridObj$subtitle <- "something clever" plotGridObj$caption <- "my sources" plotGridObj$nColumns <- 2L plotGridObj$tagLevels <- "A" plotGridObj$tagPrefix <- "Plot (" plotGridObj$tagSuffix <- ")" plotGridObj$tagColor <- "blue" plotGridObj$tagSize <- 15 plotGridObj$tagAngle <- 45 plotGridObj$tagPosition <- TagPositions$top plotGridObj$titleHorizontalJustification <- HorizontalJustification$middle plotGridObj$subtitleHorizontalJustification <- HorizontalJustification$middle # print the object to see its properties plotGridObj ## ------------------------------------------------ ## Method `PlotGridConfiguration$addPlots` ## ------------------------------------------------ library(ggplot2) myPlotGrid <- PlotGridConfiguration$new() # You can add a single ggplot object p <- ggplot(mtcars, aes(wt, mpg)) + geom_point() myPlotGrid$addPlots(p) # Or you can also pass a list myPlotGrid$addPlots(list("p1" = ggplot(), "p2" = ggplot())) # Since we added three plots, the `plotList` field should # now be a list of length `3` length(myPlotGrid$plotList)
Producing Histograms
plotHistogram( data = NULL, metaData = NULL, x = NULL, dataMapping = NULL, frequency = NULL, bins = NULL, binwidth = NULL, stack = NULL, distribution = NULL, plotConfiguration = NULL, plotObject = NULL )plotHistogram( data = NULL, metaData = NULL, x = NULL, dataMapping = NULL, frequency = NULL, bins = NULL, binwidth = NULL, stack = NULL, distribution = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
x |
Numeric values to plot along the |
dataMapping |
A |
frequency |
logical defining if histogram displays a frequency in y axis |
bins |
Number or edges of bins.
If |
binwidth |
Numerical value of defining the width of each bin.
If defined, |
stack |
Logical defining for multiple histograms if their bars are stacked
Default value, |
distribution |
Name of distribution to fit to the data.
Only 2 distributions are currently available: |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/histogram.html
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce histogram of normally distributed data plotHistogram(x = rnorm(100)) # Produce histogram of normally distributed data normalized in y axis plotHistogram(x = rnorm(100), frequency = TRUE) # Produce histogram of normally distributed data with many bins plotHistogram(x = rlnorm(100), bins = 21) # Produce histogram of fitted normally distributed data plotHistogram(x = rlnorm(100), distribution = "normal") # Produce histogram of fitted normally distributed data plotHistogram(x = rlnorm(100), distribution = "normal", frequency = TRUE, stack = TRUE)# Produce histogram of normally distributed data plotHistogram(x = rnorm(100)) # Produce histogram of normally distributed data normalized in y axis plotHistogram(x = rnorm(100), frequency = TRUE) # Produce histogram of normally distributed data with many bins plotHistogram(x = rlnorm(100), bins = 21) # Produce histogram of fitted normally distributed data plotHistogram(x = rlnorm(100), distribution = "normal") # Produce histogram of fitted normally distributed data plotHistogram(x = rlnorm(100), distribution = "normal", frequency = TRUE, stack = TRUE)
Producing Time Profile plots for observed data
plotObservedTimeProfile( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )plotObservedTimeProfile( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
An |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce a Time profile plot with observed data obsData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotObservedTimeProfile( data = obsData, dataMapping = ObservedDataMapping$new(x = "x", y = "y") )# Produce a Time profile plot with observed data obsData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotObservedTimeProfile( data = obsData, dataMapping = ObservedDataMapping$new(x = "x", y = "y") )
Producing observed vs predicted plots
plotObsVsPred( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, foldDistance = NULL, smoother = NULL, plotObject = NULL )plotObsVsPred( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, foldDistance = NULL, smoother = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
plotConfiguration |
An optional |
foldDistance |
Numeric values of fold distance lines to display in log plots.
This argument is internally translated into |
smoother |
Optional name of smoother function:
|
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce Obs vs Pred plot obsVsPredData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotObsVsPred(data = obsVsPredData, dataMapping = ObsVsPredDataMapping$new(x = "x", y = "y")) # Produce Obs vs Pred plot with linear regression plotObsVsPred( data = obsVsPredData, dataMapping = ObsVsPredDataMapping$new(x = "x", y = "y"), smoother = "lm" ) # Produce Obs vs Pred plot with user-defined fold distance lines plotObsVsPred( data = obsVsPredData, dataMapping = ObsVsPredDataMapping$new(x = "x", y = "y"), plotConfiguration = ObsVsPredPlotConfiguration$new( xScale = Scaling$log, xAxisLimits = c(0.05, 50), yScale = Scaling$log, yAxisLimits = c(0.05, 50) ), foldDistance = c(1, 10) )# Produce Obs vs Pred plot obsVsPredData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotObsVsPred(data = obsVsPredData, dataMapping = ObsVsPredDataMapping$new(x = "x", y = "y")) # Produce Obs vs Pred plot with linear regression plotObsVsPred( data = obsVsPredData, dataMapping = ObsVsPredDataMapping$new(x = "x", y = "y"), smoother = "lm" ) # Produce Obs vs Pred plot with user-defined fold distance lines plotObsVsPred( data = obsVsPredData, dataMapping = ObsVsPredDataMapping$new(x = "x", y = "y"), plotConfiguration = ObsVsPredPlotConfiguration$new( xScale = Scaling$log, xAxisLimits = c(0.05, 50), yScale = Scaling$log, yAxisLimits = c(0.05, 50) ), foldDistance = c(1, 10) )
Producing a Pie Chart
plotPieChart( data = NULL, metaData = NULL, dataMapping = NULL, colorPalette = NULL, start = NULL, clockwiseDirection = NULL, plotConfiguration = NULL, plotObject = NULL )plotPieChart( data = NULL, metaData = NULL, dataMapping = NULL, colorPalette = NULL, start = NULL, clockwiseDirection = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
colorPalette |
color palette property from |
start |
Offset of starting point from 12 o'clock in radians. Offset is applied clockwise or anticlockwise depending on value of direction |
clockwiseDirection |
logical defining if values are displayed in clockwise order |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Data for the pie chart values <- runif(5) data <- data.frame( values = values, text = paste0(round(100 * values / sum(values)), "%"), legend = letters[1:5] ) # Plot pie chart with its legend plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", fill = "legend") ) # Plot pie chart with text within pie plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", y = "text", fill = "legend") ) # Reverse direction of pie chart plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", y = "text", fill = "legend"), clockwiseDirection = FALSE ) # Start first slice of pie at 90 degrees plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", y = "text", fill = "legend"), start = pi / 2 ) # Leverages ggplot color palettes plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", y = "text", fill = "legend"), colorPalette = ColorPalettes$Set1 )# Data for the pie chart values <- runif(5) data <- data.frame( values = values, text = paste0(round(100 * values / sum(values)), "%"), legend = letters[1:5] ) # Plot pie chart with its legend plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", fill = "legend") ) # Plot pie chart with text within pie plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", y = "text", fill = "legend") ) # Reverse direction of pie chart plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", y = "text", fill = "legend"), clockwiseDirection = FALSE ) # Start first slice of pie at 90 degrees plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", y = "text", fill = "legend"), start = pi / 2 ) # Leverages ggplot color palettes plotPieChart( data = data, dataMapping = PieChartDataMapping$new(x = "values", y = "text", fill = "legend"), colorPalette = ColorPalettes$Set1 )
Producing PK Ratio plots
plotPKRatio( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, foldDistance = NULL, plotObject = NULL )plotPKRatio( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, foldDistance = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
plotConfiguration |
An optional |
foldDistance |
Numeric values of fold distance lines to display in log plots.
This argument is internally translated into |
plotObject |
An optional |
A ggplot object
For examples, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/pk-ratio-vignette.html
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce PK Ratio plot pkData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotPKRatio(data = pkData, dataMapping = PKRatioDataMapping$new(x = "x", y = "y")) # Produce PK Ratio plot with user-defined horizontal lines plotPKRatio( data = pkData, dataMapping = PKRatioDataMapping$new(x = "x", y = "y"), foldDistance = c(1, 10) )# Produce PK Ratio plot pkData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotPKRatio(data = pkData, dataMapping = PKRatioDataMapping$new(x = "x", y = "y")) # Produce PK Ratio plot with user-defined horizontal lines plotPKRatio( data = pkData, dataMapping = PKRatioDataMapping$new(x = "x", y = "y"), foldDistance = c(1, 10) )
Producing Histograms
plotQQ( data = NULL, metaData = NULL, y = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )plotQQ( data = NULL, metaData = NULL, y = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
y |
Numeric values to plot along the |
dataMapping |
A |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce QQ plot of normally distributed data plotQQ(y = rnorm(100)) # Produce QQ plot of normally distributed data split by group qqData <- data.frame( residuals = c(rnorm(100), rnorm(100)), groups = c(rep("Group A", 100), rep("Group B", 100)) ) plotQQ( data = qqData, dataMapping = QQDataMapping$new(y = "residuals", group = "groups") )# Produce QQ plot of normally distributed data plotQQ(y = rnorm(100)) # Produce QQ plot of normally distributed data split by group qqData <- data.frame( residuals = c(rnorm(100), rnorm(100)), groups = c(rep("Group A", 100), rep("Group B", 100)) ) plotQQ( data = qqData, dataMapping = QQDataMapping$new(y = "residuals", group = "groups") )
Producing residuals vs predicted plots
plotResVsPred( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, smoother = NULL, plotObject = NULL )plotResVsPred( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, smoother = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
plotConfiguration |
An optional |
smoother |
Optional name of smoother function:
|
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce Obs vs Pred plot resVsPredData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotResVsPred(data = resVsPredData, dataMapping = ResVsPredDataMapping$new(x = "x", y = "y")) # Produce Res vs Pred plot with linear regression plotResVsPred( data = resVsPredData, dataMapping = ResVsPredDataMapping$new(x = "x", y = "y"), smoother = "lm" )# Produce Obs vs Pred plot resVsPredData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotResVsPred(data = resVsPredData, dataMapping = ResVsPredDataMapping$new(x = "x", y = "y")) # Produce Res vs Pred plot with linear regression plotResVsPred( data = resVsPredData, dataMapping = ResVsPredDataMapping$new(x = "x", y = "y"), smoother = "lm" )
Producing residuals vs time plots
plotResVsTime( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, smoother = NULL, plotObject = NULL )plotResVsTime( data, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, smoother = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
plotConfiguration |
An optional |
smoother |
Optional name of smoother function:
|
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotSimulatedTimeProfile(),
plotTimeProfile(),
plotTornado()
# Produce Obs vs Pred plot resVsTimeData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotResVsTime(data = resVsTimeData, dataMapping = ResVsTimeDataMapping$new(x = "x", y = "y")) # Produce Res vs Time plot with linear regression plotResVsTime( data = resVsTimeData, dataMapping = ResVsTimeDataMapping$new(x = "x", y = "y"), smoother = "lm" )# Produce Obs vs Pred plot resVsTimeData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) plotResVsTime(data = resVsTimeData, dataMapping = ResVsTimeDataMapping$new(x = "x", y = "y")) # Produce Res vs Time plot with linear regression plotResVsTime( data = resVsTimeData, dataMapping = ResVsTimeDataMapping$new(x = "x", y = "y"), smoother = "lm" )
Producing Time Profile plots
plotSimulatedTimeProfile( data = NULL, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )plotSimulatedTimeProfile( data = NULL, metaData = NULL, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotTimeProfile(),
plotTornado()
# Produce a Time profile plot with simulated data simTime <- seq(1, 10, 0.1) simData <- data.frame( x = simTime, y = 10 * exp(-simTime), ymin = 8 * exp(-simTime), ymax = 12 * exp(-simTime) ) plotSimulatedTimeProfile( data = simData, dataMapping = TimeProfileDataMapping$new(x = "x", y = "y", ymin = "ymin", ymax = "ymax") )# Produce a Time profile plot with simulated data simTime <- seq(1, 10, 0.1) simData <- data.frame( x = simTime, y = 10 * exp(-simTime), ymin = 8 * exp(-simTime), ymax = 12 * exp(-simTime) ) plotSimulatedTimeProfile( data = simData, dataMapping = TimeProfileDataMapping$new(x = "x", y = "y", ymin = "ymin", ymax = "ymax") )
Producing Time Profile plots
plotTimeProfile( data = NULL, metaData = NULL, dataMapping = NULL, observedData = NULL, observedDataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )plotTimeProfile( data = NULL, metaData = NULL, dataMapping = NULL, observedData = NULL, observedDataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
dataMapping |
A |
observedData |
A data.frame to use for plot.
Unlike |
observedDataMapping |
An |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTornado()
# Produce a Time profile plot with observed and simulated data obsData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) simTime <- seq(1, 10, 0.1) simData <- data.frame( x = simTime, y = 10 * exp(-simTime), ymin = 8 * exp(-simTime), ymax = 12 * exp(-simTime) ) plotTimeProfile( data = simData, observedData = obsData, dataMapping = TimeProfileDataMapping$new(x = "x", y = "y", ymin = "ymin", ymax = "ymax"), observedDataMapping = ObservedDataMapping$new(x = "x", y = "y") )# Produce a Time profile plot with observed and simulated data obsData <- data.frame(x = c(1, 2, 1, 2, 3), y = c(5, 0.2, 2, 3, 4)) simTime <- seq(1, 10, 0.1) simData <- data.frame( x = simTime, y = 10 * exp(-simTime), ymin = 8 * exp(-simTime), ymax = 12 * exp(-simTime) ) plotTimeProfile( data = simData, observedData = obsData, dataMapping = TimeProfileDataMapping$new(x = "x", y = "y", ymin = "ymin", ymax = "ymax"), observedDataMapping = ObservedDataMapping$new(x = "x", y = "y") )
Producing tornado plots
plotTornado( data = NULL, metaData = NULL, x = NULL, y = NULL, sorted = NULL, colorPalette = NULL, bar = TRUE, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )plotTornado( data = NULL, metaData = NULL, x = NULL, y = NULL, sorted = NULL, colorPalette = NULL, bar = TRUE, dataMapping = NULL, plotConfiguration = NULL, plotObject = NULL )
data |
A data.frame to use for plot. |
metaData |
A named list of information about |
x |
Numeric values to plot along the |
y |
Character values to plot along the |
sorted |
Optional logical value defining if |
colorPalette |
Optional character values defining a |
bar |
Optional logical value setting tornado plot as bar plot instead of scatter plot. |
dataMapping |
A |
plotConfiguration |
An optional |
plotObject |
An optional |
A ggplot object
Other molecule plots:
plotBoxWhisker(),
plotCumulativeTimeProfile(),
plotDDIRatio(),
plotGrid(),
plotHistogram(),
plotObsVsPred(),
plotObservedTimeProfile(),
plotPKRatio(),
plotPieChart(),
plotQQ(),
plotResVsPred(),
plotResVsTime(),
plotSimulatedTimeProfile(),
plotTimeProfile()
# Produce a tornado plot plotTornado(x = c(2, -1, 3), y = c("A", "B", "C")) # Produce a tornado plot as scatter plot plotTornado(x = c(2, -1, 3), y = c("A", "B", "C"), bar = FALSE) # Produce a tornado plot as is (no sorting) plotTornado(x = c(2, -1, 3), y = c("A", "B", "C"), sorted = FALSE)# Produce a tornado plot plotTornado(x = c(2, -1, 3), y = c("A", "B", "C")) # Produce a tornado plot as scatter plot plotTornado(x = c(2, -1, 3), y = c("A", "B", "C"), bar = FALSE) # Produce a tornado plot as is (no sorting) plotTornado(x = c(2, -1, 3), y = c("A", "B", "C"), sorted = FALSE)
R6 class for mapping x, y and GroupMapping variables to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> QQDataMapping
checkMapData()
Check that data variables include map variables
QQDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and defaultAes variables.
Dummy variable defaultAes is necessary to allow further modification of plots.
clone()
The objects of this class are cloneable with this method.
QQDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for Quantile-Quantile plots
tlf::PlotConfiguration -> QQPlotConfiguration
new()
Create a new QQPlotConfiguration object
QQPlotConfiguration$new(xlabel = "Standard Normal Quantiles", ...)
xlabelQQ-plot default display is "Standard Normal Quantiles"
...parameters inherited from PlotConfiguration
A new QQPlotConfiguration object
clone()
The objects of this class are cloneable with this method.
QQPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
R6 class for mapping x, ymin and ymax variable to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> RangeDataMapping
yminName of ymin variable to map
ymaxName of ymax variable to map
new()
Create a new RangeDataMapping object
RangeDataMapping$new( x = NULL, ymin = NULL, ymax = NULL, groupMapping = NULL, color = NULL, fill = NULL, linetype = NULL, shape = NULL, size = NULL, group = NULL, data = NULL )
xName of x variable to map
yminName of ymin variable to map
ymaxName of ymax variable to map
groupMappingR6 class GroupMapping object
colorR6 class Grouping object or its input
fillR6 class Grouping object or its input
linetypeR6 class Grouping object or its input
shapeR6 class Grouping object or its input
sizeR6 class Grouping object or its input
groupR6 class Grouping object or its input
datadata.frame to map used by .smartMapping
A new RangeDataMapping object
checkMapData()
Check that data variables include map variables
RangeDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and legendLabels variables.
Dummy variable legendLabels is necessary to allow further modification of plots.
clone()
The objects of this class are cloneable with this method.
RangeDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
Reset the global settings stored in tlfEnv to default values defined by the package.
resetTLFSettingsToDefault()resetTLFSettingsToDefault()
Class for mapping variables in residuals vs predictions/time plot
tlf::XYDataMapping -> tlf::XYGDataMapping -> tlf::ObsVsPredDataMapping -> ResVsPredDataMapping
clone()
The objects of this class are cloneable with this method.
ResVsPredDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for Res vs Pred/Time plots
tlf::PlotConfiguration -> ResVsPredPlotConfiguration
defaultSymmetricAxesDefault option setting symmetric xAxis and/or yAxis limits when creating a ResVsPredPlotConfiguration object
clone()
The objects of this class are cloneable with this method.
ResVsPredPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
Class for mapping variables in residuals vs predictions/time plot
tlf::XYDataMapping -> tlf::XYGDataMapping -> tlf::ObsVsPredDataMapping -> tlf::ResVsPredDataMapping -> ResVsTimeDataMapping
clone()
The objects of this class are cloneable with this method.
ResVsTimeDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for Res vs Pred/Time plots
tlf::PlotConfiguration -> tlf::ResVsPredPlotConfiguration -> ResVsTimePlotConfiguration
clone()
The objects of this class are cloneable with this method.
ResVsTimePlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
Run shiny app that allows to easily make plots from user interface.
runPlotMaker()runPlotMaker()
For tutorial, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/plot-maker.html
Other shiny apps:
runThemeMaker()
Run shiny app that allows easy setting of Theme objects. Theme objects drive default properties of plots
runThemeMaker()runThemeMaker()
For tutorial, see: https://www.open-systems-pharmacology.org/TLF-Library/articles/theme-maker.html
Other shiny apps:
runPlotMaker()
Save theme object to a json file.
saveThemeToJson(jsonFile, theme = NULL)saveThemeToJson(jsonFile, theme = NULL)
jsonFile |
path of json file |
theme |
|
.RData filesaveTLFSettings
Save the current TLF global settings in a .RData file
saveTLFSettings(file)saveTLFSettings(file)
file |
|
Helper enum of predefined transformations of axes Note that the
transformations will be translated internally into ggplot2
transformations. ggplot2 includes more transformations than what is
available in this enum.
ScalingScaling
An object of class list of length 9.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
# Continuous linear/identity scale Scaling$identity Scaling$lin # Continuous log10 scale Scaling$log # Continuous natural logarithm (ln) scale (base is *e*) Scaling$ln # Discrete scale for categrical data such as boxplot and tornado plot data Scaling$discrete # Reverse continuous linear scale to switch end and beginning of linear scale Scaling$reverse # Continusous square root scale Scaling$sqrt # Time scale for POSIXlt or POSIXct data Scaling$time # Date scale for POSIXlt or POSIXct data Scaling$date# Continuous linear/identity scale Scaling$identity Scaling$lin # Continuous log10 scale Scaling$log # Continuous natural logarithm (ln) scale (base is *e*) Scaling$ln # Discrete scale for categrical data such as boxplot and tornado plot data Scaling$discrete # Reverse continuous linear scale to switch end and beginning of linear scale Scaling$reverse # Continusous square root scale Scaling$sqrt # Time scale for POSIXlt or POSIXct data Scaling$time # Date scale for POSIXlt or POSIXct data Scaling$date
Set background properties of a ggplot object
setBackground( plotObject, fill = NULL, color = NULL, linetype = NULL, size = NULL )setBackground( plotObject, fill = NULL, color = NULL, linetype = NULL, size = NULL )
plotObject |
A |
fill |
Optional character values defining the color of the background.
See |
color |
Optional character values defining the color of the background frame.
See |
linetype |
Optional character values defining the linetype of the background frame.
See enum |
size |
Optional numeric values defining the size of the background frame. |
A ggplot object
# Set background of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setBackground(p, fill = "yellowgreen", color = "red", linetype = "dotted")# Set background of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setBackground(p, fill = "yellowgreen", color = "red", linetype = "dotted")
Set background panel area properties of a ggplot object
setBackgroundPanelArea( plotObject, fill = NULL, color = NULL, linetype = NULL, size = NULL )setBackgroundPanelArea( plotObject, fill = NULL, color = NULL, linetype = NULL, size = NULL )
plotObject |
A |
fill |
Optional character values defining the color of the background.
See |
color |
Optional character values defining the color of the background frame.
See |
linetype |
Optional character values defining the linetype of the background frame.
See enum |
size |
Optional numeric values defining the size of the background frame. |
A ggplot object
# Set background of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setBackgroundPanelArea(p, fill = "yellowgreen", color = "red", linetype = "dotted")# Set background of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setBackgroundPanelArea(p, fill = "yellowgreen", color = "red", linetype = "dotted")
Set background plot area properties of a ggplot object
setBackgroundPlotArea( plotObject, fill = NULL, color = NULL, linetype = NULL, size = NULL )setBackgroundPlotArea( plotObject, fill = NULL, color = NULL, linetype = NULL, size = NULL )
plotObject |
A |
fill |
Optional character values defining the color of the background.
See |
color |
Optional character values defining the color of the background frame.
See |
linetype |
Optional character values defining the linetype of the background frame.
See enum |
size |
Optional numeric values defining the size of the background frame. |
A ggplot object
# Set background of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setBackgroundPlotArea(p, fill = "yellowgreen", color = "red", linetype = "dotted")# Set background of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setBackgroundPlotArea(p, fill = "yellowgreen", color = "red", linetype = "dotted")
Set the colors of the data in plot and legend caption
setCaptionColor(plotObject, color, name = NULL)setCaptionColor(plotObject, color, name = NULL)
plotObject |
|
color |
colors of the data in plot and legend caption |
name |
reference names in caption$name identifying the legend caption lines |
A ggplot graphical object
Set the fills of the data in plot and legend caption
setCaptionFill(plotObject, fill, name = NULL)setCaptionFill(plotObject, fill, name = NULL)
plotObject |
|
fill |
fills of the data in plot and legend caption |
name |
reference names in caption$name identifying the legend caption lines |
A ggplot graphical object
Set the legend caption labels
setCaptionLabels(plotObject, label, name = NULL)setCaptionLabels(plotObject, label, name = NULL)
plotObject |
|
label |
new labels of the legend caption |
name |
reference names in caption$name identifying the legend caption lines |
A ggplot graphical object
Set the linetypes of the data in plot and legend caption
setCaptionLinetype(plotObject, linetype, name = NULL)setCaptionLinetype(plotObject, linetype, name = NULL)
plotObject |
|
linetype |
linetypes of the data in plot and legend caption |
name |
reference names in caption$name identifying the legend caption lines |
A ggplot graphical object
Set the order of the legend caption labels
setCaptionOrder(plotObject, order, name = NULL)setCaptionOrder(plotObject, order, name = NULL)
plotObject |
|
order |
numeric order of the legend caption labels |
name |
reference names in caption$name identifying the legend caption lines |
A ggplot graphical object
Set the shapes of the data in plot and legend caption
setCaptionShape(plotObject, shape, name = NULL)setCaptionShape(plotObject, shape, name = NULL)
plotObject |
|
shape |
shapes of the data in plot and legend caption |
name |
reference names in caption$name identifying the legend caption lines |
A ggplot graphical object
Set the sizes of the data in plot and legend caption
setCaptionSize(plotObject, size, name = NULL)setCaptionSize(plotObject, size, name = NULL)
plotObject |
|
size |
sizes of the data in plot and legend caption |
name |
reference names in caption$name identifying the legend caption lines |
A ggplot graphical object
Set the visibility of the legend caption labels
setCaptionVisibility(plotObject, visibility, name = NULL)setCaptionVisibility(plotObject, visibility, name = NULL)
plotObject |
|
visibility |
logical visibility of the legend caption labels |
name |
reference names in caption$name identifying the legend caption lines |
A ggplot graphical object
Set default aggregation bins of tlf environment
setDefaultAggregationBins(bins = NULL)setDefaultAggregationBins(bins = NULL)
bins |
Number of bins if value, edges if vector or binning function if function |
# Set default number of bins plotHistogram(x = rnorm(1000)) setDefaultAggregationBins(21) plotHistogram(x = rnorm(1000))# Set default number of bins plotHistogram(x = rnorm(1000)) setDefaultAggregationBins(21) plotHistogram(x = rnorm(1000))
Set default aggregation functions of tlf environment
setDefaultAggregationFunctions(y = NULL, ymin = NULL, ymax = NULL)setDefaultAggregationFunctions(y = NULL, ymin = NULL, ymax = NULL)
y |
function or its name as median aggregation |
ymin |
function or its name as min aggregation |
ymax |
function or its name as max aggregation |
Set default aggregation labels of tlf environment
setDefaultAggregationLabels(y = NULL, range = NULL)setDefaultAggregationLabels(y = NULL, range = NULL)
y |
label for median aggregation |
range |
label for range aggregation |
Set the default alpha (transparency) difference ratio between points above and bellow lloq
setDefaultAlphaRatio(alphaRatio)setDefaultAlphaRatio(alphaRatio)
alphaRatio |
alpha ratio to set as default. Must be between 0 and 1. |
Set default cap size of error bars
setDefaultErrorbarCapSize(size)setDefaultErrorbarCapSize(size)
size |
A numeric defining the size of the error bar caps in pts |
Set default tlf properties for exporting/saving plots
setDefaultExportParameters( format = NULL, width = NULL, height = NULL, units = NULL, dpi = NULL, name = NULL )setDefaultExportParameters( format = NULL, width = NULL, height = NULL, units = NULL, dpi = NULL, name = NULL )
format |
file format of the exported plots |
width |
plot width in |
height |
plot height in |
units |
units of |
dpi |
units of |
name |
base file name of the exported plots |
Set default legend position of tlf environment
setDefaultLegendPosition(position)setDefaultLegendPosition(position)
position |
legend position.
Use Enum |
Set default legend title of tlf environment
setDefaultLegendTitle(title)setDefaultLegendTitle(title)
title |
Character or |
Set default cap linetype for lloq lines
setDefaultLLOQLinetype(linetype)setDefaultLLOQLinetype(linetype)
linetype |
linetype to set as default |
Set default values for log ticks
setDefaultLogTicks(ticks)setDefaultLogTicks(ticks)
ticks |
numeric values where ticks are placed. Ensure that the values are positive (they are meant for log scale) |
Set the maximum number of characters per row for axis ticks labels and legend. Long strings will be wraped on spaces or non-word characters.
setDefaultMaxCharacterWidth(maxCharacterWidth)setDefaultMaxCharacterWidth(maxCharacterWidth)
maxCharacterWidth |
the maximum number of characters per row |
Set default watermark value for current theme
setDefaultWatermark(watermark = NULL)setDefaultWatermark(watermark = NULL)
watermark |
A character value or |
# Set default watermark using a character setDefaultWatermark("Confidential") addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) # Set default watermark using a `Label` object setDefaultWatermark(Label$new(text = "Confidential", color = "red", angle = 30)) addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4))# Set default watermark using a character setDefaultWatermark("Confidential") addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) # Set default watermark using a `Label` object setDefaultWatermark(Label$new(text = "Confidential", color = "red", angle = 30)) addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4))
Set x and y grid properties of a ggplot object
setGrid(plotObject, color = NULL, linetype = NULL, size = NULL)setGrid(plotObject, color = NULL, linetype = NULL, size = NULL)
plotObject |
A |
color |
Optional character values defining the color of the grid.
See |
linetype |
Optional character values defining the linetype of the grid.
See enum |
size |
Optional numeric values defining the size of the grid. |
A ggplot object
# Set grid of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setGrid(p, color = "red", linetype = "dotted")# Set grid of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setGrid(p, color = "red", linetype = "dotted")
Set legend position, title, font and/or caption
setLegend( plotObject, position = NULL, title = NULL, font = NULL, caption = NULL )setLegend( plotObject, position = NULL, title = NULL, font = NULL, caption = NULL )
plotObject |
Graphical object created from ggplot |
position |
legend position.
Use enum |
title |
character or |
font |
|
caption |
data.frame containing the caption properties of the legend |
A ggplot object
Set the legend caption
setLegendCaption(plotObject, caption = NULL)setLegendCaption(plotObject, caption = NULL)
plotObject |
|
caption |
data.frame containing the caption properties of the legend |
A ggplot graphical object
Set legend font properties
setLegendFont( plotObject, color = NULL, size = NULL, fontFamily = NULL, fontFace = NULL, angle = NULL, align = NULL )setLegendFont( plotObject, color = NULL, size = NULL, fontFamily = NULL, fontFace = NULL, angle = NULL, align = NULL )
plotObject |
ggplot object |
color |
character defining the color of legend font |
size |
numeric defining the size of legend font |
fontFamily |
character defining the family of legend font |
fontFace |
character defining the legend font face as defined in helper enum |
angle |
numeric defining the angle of legend font |
align |
character defining the alignment of legend font as defined in helper enum |
A ggplot object
Set the legend position
setLegendPosition(plotObject, position = NULL)setLegendPosition(plotObject, position = NULL)
plotObject |
|
position |
legend position as defined in helper enum |
A ggplot graphical object
LegendPositions
Set legend title
setLegendTitle(plotObject, title = NULL)setLegendTitle(plotObject, title = NULL)
plotObject |
ggplot object |
title |
character or |
A ggplot object
Set plot export properties
setPlotExport( plotObject, name = NULL, format = NULL, width = NULL, height = NULL, units = NULL, dpi = NULL )setPlotExport( plotObject, name = NULL, format = NULL, width = NULL, height = NULL, units = NULL, dpi = NULL )
plotObject |
Graphical object created from ggplot |
name |
character defining the name of the file to be saved (without extension) |
format |
character defining the format of the file to be saved. |
width |
numeric values defining the width in |
height |
numeric values defining the height in |
units |
character defining the unit of the saving dimension |
dpi |
numeric value defining plot resolution (dots per inch) |
ggplot object with updated saving properties
Set plot export properties
setPlotExportDimensions( plotObject, width = NULL, height = NULL, units = NULL, dpi = NULL )setPlotExportDimensions( plotObject, width = NULL, height = NULL, units = NULL, dpi = NULL )
plotObject |
Graphical object created from ggplot |
width |
plot width in |
height |
plot height in |
units |
units of |
dpi |
numeric value defining plot resolution (dots per inch) |
ggplot object with updated labels
Set plot export properties
setPlotExportFormat(plotObject, format = NULL)setPlotExportFormat(plotObject, format = NULL)
plotObject |
Graphical object created from ggplot |
format |
file format of the exported plot |
ggplot object with updated labels
Set plot export properties
setPlotExportSize( plotObject, width = NULL, height = NULL, units = NULL, dpi = NULL )setPlotExportSize( plotObject, width = NULL, height = NULL, units = NULL, dpi = NULL )
plotObject |
Graphical object created from ggplot |
width |
plot width in |
height |
plot height in |
units |
units of |
dpi |
numeric value defining plot resolution (dots per inch) |
ggplot object with updated labels
Set labels properties on a ggplot object
setPlotLabels( plotObject, title = NULL, subtitle = NULL, xlabel = NULL, ylabel = NULL, caption = NULL )setPlotLabels( plotObject, title = NULL, subtitle = NULL, xlabel = NULL, ylabel = NULL, caption = NULL )
plotObject |
A |
title |
A character value or |
subtitle |
A character value or |
xlabel |
A character value or |
ylabel |
A character value or |
caption |
A character value or |
A ggplot object
# Set labels of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setPlotLabels(p, xlabel = "new x label", ylabel = "new y label") # Set labels using Label object setPlotLabels(p, ylabel = Label$new(text = "red y label", color = "red"))# Set labels of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setPlotLabels(p, xlabel = "new x label", ylabel = "new y label") # Set labels using Label object setPlotLabels(p, ylabel = Label$new(text = "red y label", color = "red"))
Set the watermark of a ggplot object.
Unlike addWatermark, the watermark layer is overridden by setWatermark.
setWatermark( plotObject, watermark = NULL, color = NULL, size = NULL, angle = NULL, alpha = NULL )setWatermark( plotObject, watermark = NULL, color = NULL, size = NULL, angle = NULL, alpha = NULL )
plotObject |
A |
watermark |
A character value or a |
color |
Color of the watermark. |
size |
Size of the watermark. |
angle |
Angle of the watermark (in degree). |
alpha |
Numeric value between 0 and 1 corresponding to transparency of the watermark The closer to 0, the more transparent the watermark is. The closer to 1, the more opaque the watermark is. |
A ggplot object
# Add a watermark to an empty plot p <- initializePlot() setWatermark(p, "watermark") # Watermark with font properties watermarkLabel <- Label$new(text = "watermark", color = "blue") setWatermark(p, watermarkLabel) # Horizontal watermark setWatermark(p, watermarkLabel, angle = 0) # Watermark totally opaque setWatermark(p, watermarkLabel, alpha = 1)# Add a watermark to an empty plot p <- initializePlot() setWatermark(p, "watermark") # Watermark with font properties watermarkLabel <- Label$new(text = "watermark", color = "blue") setWatermark(p, watermarkLabel) # Horizontal watermark setWatermark(p, watermarkLabel, angle = 0) # Watermark totally opaque setWatermark(p, watermarkLabel, alpha = 1)
Set X-axis properties of a ggplot object
setXAxis( plotObject, scale = NULL, valuesLimits = NULL, axisLimits = NULL, limits = lifecycle::deprecated(), ticks = NULL, ticklabels = NULL, minorTicks = NULL, font = NULL, expand = NULL )setXAxis( plotObject, scale = NULL, valuesLimits = NULL, axisLimits = NULL, limits = lifecycle::deprecated(), ticks = NULL, ticklabels = NULL, minorTicks = NULL, font = NULL, expand = NULL )
plotObject |
A |
scale |
Scale of axis. Use enum |
valuesLimits |
Optional numeric values of values limits |
axisLimits |
Optional numeric values of axis limits |
limits |
|
ticks |
Optional values or function for axis ticks |
ticklabels |
Optional values or function for axis ticklabels |
minorTicks |
Optional values or function for axis minor ticks |
font |
A |
expand |
Logical defining if data is expanded until axis |
A ggplot object
myPlot <- addLine(x = c(1, 2, 3), y = c(10, 50, 100)) # Set x-axis in log scale setXAxis(myPlot, scale = Scaling$log) # Set x-axis ticklabels to Greek letters setXAxis(myPlot, ticks = c(1, 2, 3), ticklabels = parse(text = c("alpha", "beta", "gamma"))) # Set x-axis limits setXAxis(myPlot, axisLimits = c(1, 2.5)) # Set x-axis fonts setXAxis(myPlot, font = Font$new(color = "blue", size = 14))myPlot <- addLine(x = c(1, 2, 3), y = c(10, 50, 100)) # Set x-axis in log scale setXAxis(myPlot, scale = Scaling$log) # Set x-axis ticklabels to Greek letters setXAxis(myPlot, ticks = c(1, 2, 3), ticklabels = parse(text = c("alpha", "beta", "gamma"))) # Set x-axis limits setXAxis(myPlot, axisLimits = c(1, 2.5)) # Set x-axis fonts setXAxis(myPlot, font = Font$new(color = "blue", size = 14))
Set x grid properties of a ggplot object
setXGrid(plotObject, color = NULL, linetype = NULL, size = NULL)setXGrid(plotObject, color = NULL, linetype = NULL, size = NULL)
plotObject |
A |
color |
Optional character values defining the color of the grid.
See |
linetype |
Optional character values defining the linetype of the grid.
See enum |
size |
Optional numeric values defining the size of the grid. |
A ggplot object
# Set x grid of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setXGrid(p, color = "red", linetype = "dotted")# Set x grid of a scatter plot p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setXGrid(p, color = "red", linetype = "dotted")
Set right Y-axis properties of a ggplot object
setY2Axis( plotObject, scale = NULL, valuesLimits = NULL, axisLimits = NULL, limits = lifecycle::deprecated(), ticks = NULL, ticklabels = NULL, minorTicks = NULL, font = NULL, expand = NULL )setY2Axis( plotObject, scale = NULL, valuesLimits = NULL, axisLimits = NULL, limits = lifecycle::deprecated(), ticks = NULL, ticklabels = NULL, minorTicks = NULL, font = NULL, expand = NULL )
plotObject |
A |
scale |
Scale of axis. Use enum |
valuesLimits |
Optional numeric values of values limits |
axisLimits |
Optional numeric values of axis limits |
limits |
|
ticks |
Optional values or function for axis ticks |
ticklabels |
Optional values or function for axis ticklabels |
minorTicks |
Optional values or function for axis minor ticks |
font |
A |
expand |
Logical defining if data is expanded until axis |
A ggplot object
Set Y-axis properties of a ggplot object
setYAxis( plotObject, scale = NULL, valuesLimits = NULL, axisLimits = NULL, limits = lifecycle::deprecated(), ticks = NULL, ticklabels = NULL, minorTicks = NULL, font = NULL, expand = NULL )setYAxis( plotObject, scale = NULL, valuesLimits = NULL, axisLimits = NULL, limits = lifecycle::deprecated(), ticks = NULL, ticklabels = NULL, minorTicks = NULL, font = NULL, expand = NULL )
plotObject |
A |
scale |
Scale of axis. Use enum |
valuesLimits |
Optional numeric values of values limits |
axisLimits |
Optional numeric values of axis limits |
limits |
|
ticks |
Optional values or function for axis ticks |
ticklabels |
Optional values or function for axis ticklabels |
minorTicks |
Optional values or function for axis minor ticks |
font |
A |
expand |
Logical defining if data is expanded until axis |
A ggplot object
myPlot <- addLine(x = c(1, 2, 3), y = c(10, 50, 100)) # Set y-axis in log scale setYAxis(myPlot, scale = Scaling$log) # Set y-axis ticklabels to Greek letters setYAxis(myPlot, ticks = c(10, 50, 100), ticklabels = parse(text = c("alpha", "beta", "gamma"))) # Set y-axis limits setYAxis(myPlot, axisLimits = c(10, 75)) # Set y-axis fonts setYAxis(myPlot, font = Font$new(color = "blue", size = 14))myPlot <- addLine(x = c(1, 2, 3), y = c(10, 50, 100)) # Set y-axis in log scale setYAxis(myPlot, scale = Scaling$log) # Set y-axis ticklabels to Greek letters setYAxis(myPlot, ticks = c(10, 50, 100), ticklabels = parse(text = c("alpha", "beta", "gamma"))) # Set y-axis limits setYAxis(myPlot, axisLimits = c(10, 75)) # Set y-axis fonts setYAxis(myPlot, font = Font$new(color = "blue", size = 14))
Set y grid properties of a ggplot object
setYGrid(plotObject, color = NULL, linetype = NULL, size = NULL)setYGrid(plotObject, color = NULL, linetype = NULL, size = NULL)
plotObject |
A |
color |
Optional character values defining the color of the grid.
See |
linetype |
Optional character values defining the linetype of the grid.
See enum |
size |
Optional numeric values defining the size of the grid. |
A ggplot object
# Set y grid of a scatter p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setYGrid(p, color = "red", linetype = "dotted")# Set y grid of a scatter p <- addScatter(x = c(1, 2, 1, 2, 3), y = c(5, 0, 2, 3, 4)) setYGrid(p, color = "red", linetype = "dotted")
List of some ggplot2 shapes.
The shapes from this enum/list are unicode characters
corresponding to their appropriate shapes.
Note that user-defined characters are also accepted by geomTLFPoint()
ShapesShapes
An object of class list of length 40.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
# Use ggplot2 to plot and label shapes shapesData <- data.frame( x = (seq_along(Shapes) - 1) %% 6, y = floor((seq_along(Shapes) - 1) / 6), shape = factor(names(Shapes), levels = names(Shapes)) ) ggplot2::ggplot(data = shapesData, ggplot2::aes(x, y)) + ggplot2::theme_void() + # Define size and color of shapes geomTLFPoint(ggplot2::aes(shape = shape), size = 8, color = "red") + # Add shape names from enum below the displayed shape ggplot2::geom_text(ggplot2::aes(label = shape), nudge_y = -0.3, size = 3) + # Use scale to display the actual shape ggplot2::scale_shape_manual(values = as.character(unlist(Shapes))) + # Remove the legend as the shape name is labelled below the shape ggplot2::guides(shape = "none") # Perform a scatter plot with blue pentagons as shape addScatter( x = 1:10, y = rlnorm(10), shape = Shapes$pentagon, color = "blue", size = 3 )# Use ggplot2 to plot and label shapes shapesData <- data.frame( x = (seq_along(Shapes) - 1) %% 6, y = floor((seq_along(Shapes) - 1) / 6), shape = factor(names(Shapes), levels = names(Shapes)) ) ggplot2::ggplot(data = shapesData, ggplot2::aes(x, y)) + ggplot2::theme_void() + # Define size and color of shapes geomTLFPoint(ggplot2::aes(shape = shape), size = 8, color = "red") + # Add shape names from enum below the displayed shape ggplot2::geom_text(ggplot2::aes(label = shape), nudge_y = -0.3, size = 3) + # Use scale to display the actual shape ggplot2::scale_shape_manual(values = as.character(unlist(Shapes))) + # Remove the legend as the shape name is labelled below the shape ggplot2::guides(shape = "none") # Perform a scatter plot with blue pentagons as shape addScatter( x = 1:10, y = rlnorm(10), shape = Shapes$pentagon, color = "blue", size = 3 )
List of all available tag positions in a plot grid.
TagPositionsTagPositions
An object of class list of length 8.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class defining theme properties
fontsThemeFont object
backgroundThemeBackground object
aestheticMapsThemeAestheticMaps object
plotConfigurationsThemePlotConfiguration object
new()
Create a new Theme object
Theme$new( fonts = NULL, background = NULL, aestheticMaps = NULL, plotConfigurations = NULL )
fontsThemeFont object
backgroundThemeBackground object
aestheticMapsThemeAestheticMaps object
plotConfigurationsThemePlotConfiguration object
A new Theme object
save()
Save Theme as a json file
Theme$save(jsonFile)
jsonFilename of json file
clone()
The objects of this class are cloneable with this method.
Theme$clone(deep = FALSE)
deepWhether to make a deep clone.
R6 class defining theme aesthetic maps
colorcolor map as character or numeric vector
fillfill map as character or numeric vector
sizesize map as numeric vector
shapeshape map as numeric vector
linetypelinetype as character vector
alphamap as numeric vector
new()
Create a new ThemeAestheticMaps object
ThemeAestheticMaps$new( color = NULL, fill = NULL, shape = NULL, size = NULL, linetype = NULL, alpha = NULL )
colorcolor map as list, character or numeric vector
fillfill map as list, character or numeric vector
shapeshape map as list, character or numeric vector
sizesize map as list, character or numeric vector
linetypelinetype map as list, character or numeric vector
alphaalpha map as list, character or numeric vector
A new ThemeAestheticMaps object
toJson()
Translate object into a json list
ThemeAestheticMaps$toJson()
A list that can be saved into a json file
clone()
The objects of this class are cloneable with this method.
ThemeAestheticMaps$clone(deep = FALSE)
deepWhether to make a deep clone.
R6 class defining how plot configurations will use aesthetic maps
tlf::ThemeAestheticMaps -> ThemeAestheticSelections
new()
Create a new ThemeAestheticSelections object
ThemeAestheticSelections$new( color = NULL, fill = NULL, shape = NULL, size = NULL, linetype = NULL, alpha = NULL )
colorselection key or values for choice of color
fillselection key or values for choice of fill
shapeselection key or values for choice of shape
sizeselection key or values for choice of size
linetypeselection key or values for choice of linetype
alphaselection key or values for choice of alpha
A new ThemeAestheticSelections object
toJson()
Translate object into a json list
ThemeAestheticSelections$toJson()
A list that can be saved into a json file
clone()
The objects of this class are cloneable with this method.
ThemeAestheticSelections$clone(deep = FALSE)
deepWhether to make a deep clone.
R6 class defining theme background properties
watermarkcharacter defining content of watermark
legendPositioncharacter defining where legend should usually be placed
legendTitlecharacter defining the content of legend title
plotBackgroundElement object for plot area properties (outside of panel)
panelBackgroundElement object for plot area properties (inside of panel)
xAxisBackgroundElement object for x axis properties
yAxisBackgroundElement object for y axis properties
y2AxisBackgroundElement object for right y axis properties
xGridBackgroundElement object for x grid properties
yGridBackgroundElement object for y grid properties
y2GridBackgroundElement object for right y grid properties
legendBackgroundElement object for legend area properties
new()
Create a new ThemeBackground object
ThemeBackground$new( watermark = NULL, legendPosition = NULL, legendTitle = NULL, plot = NULL, panel = NULL, xAxis = NULL, yAxis = NULL, y2Axis = NULL, xGrid = NULL, yGrid = NULL, y2Grid = NULL, legend = NULL, baseFill = "white", baseColor = "black", baseSize = 0.5, baseLinetype = "solid" )
watermarkcharacter defining content of watermark
legendPositioncharacter defining where legend should usually be placed
legendTitlecharacter defining the content of legend title
plotBackgroundElement object or list for plot area properties (outside of panel)
panelBackgroundElement object or list for plot area properties (inside of panel)
xAxisBackgroundElement object or list for x axis properties
yAxisBackgroundElement object or list for y axis properties
y2AxisBackgroundElement object or list for right y axis properties
xGridBackgroundElement object or list for x grid properties
yGridBackgroundElement object or list for y grid properties
y2GridBackgroundElement object or list for right y grid properties
legendBackgroundElement object or list for legend area properties
baseFillname of base color fill of undefined background elements. Default is "white".
baseColorname of base color of undefined background elements. Default is "black".
baseSizename of base size of undefined background elements. Default is 0.5.
baseLinetypename of base size of undefined background elements. Default is "solid".
A new ThemeBackground object
toJson()
Translate object into a json list
ThemeBackground$toJson()
A list that can be saved into a json file
clone()
The objects of this class are cloneable with this method.
ThemeBackground$clone(deep = FALSE)
deepWhether to make a deep clone.
R6 class defining theme font properties
titleFont object for font properties title
subtitleFont object for font properties of subtitle
xlabelFont object for font properties of xlabel
ylabelFont object for font properties of ylabel
y2labelFont object for font properties of y2label
captionFont object for font properties of caption
watermarkFont object for font properties of watermark
legendTitleFont object for font properties of legend title
legendFont object for font properties of legend
xAxisFont object for font properties of xAxis
yAxisFont object for font properties of yAxis
y2AxisFont object for font properties of y2Axis
new()
Create a new ThemeFont object
ThemeFont$new( title = NULL, subtitle = NULL, xlabel = NULL, ylabel = NULL, y2label = NULL, caption = NULL, watermark = NULL, legendTitle = NULL, legend = NULL, xAxis = NULL, yAxis = NULL, y2Axis = NULL, baseColor = "black", baseSize = 12, baseFace = "plain", baseFamily = "", baseAngle = 0, baseAlign = "center", baseMaxWidth = NULL )
titleFont object or list for font properties title
subtitleFont object or list for font properties of subtitle
xlabelFont object or list for font properties of xlabel
ylabelFont object or list for font properties of ylabel
y2labelFont object or list for font properties of y2label
captionFont object or list for font properties of caption
watermarkFont object or list for font properties of watermark
legendTitleFont object or list for font properties of legend title
legendFont object or list for font properties of legend
xAxisFont object or list for font properties of xAxis
yAxisFont object or list for font properties of yAxis
y2AxisFont object or list for font properties of y2Axis
baseColorname of base color of undefined fonts. Default is "black".
baseSizebase size of undefined fonts. Default is 12.
baseFacename of base face of undefined fonts. Default is "plain".
baseFamilyname of base family of undefined fonts. Default is "".
baseAnglebase angle of undefined fonts. Default is 0 degree.
baseAlignbase alignment of undefined fonts. Default is "center".
baseMaxWidthbase maximum ggplot2 "pt" unit in which text is drawn.
A new ThemeFont object
toJson()
Translate object into a json list
ThemeFont$toJson()
A list that can be saved into a json file
clone()
The objects of this class are cloneable with this method.
ThemeFont$clone(deep = FALSE)
deepWhether to make a deep clone.
R6 class defining theme of plot configuration objects
addScattertheme properties for PlotConfiguration objects as used in function addScatter()
addLinetheme properties for PlotConfiguration objects as used in function addLine()
addRibbontheme properties for PlotConfiguration objects as used in function addRibbon()
addErrorbartheme properties for PlotConfiguration objects as used in function addErrorbar()
new()
Create a new ThemePlotConfigurations object
ThemePlotConfigurations$new( addScatter = NULL, addLine = NULL, addRibbon = NULL, addErrorbar = NULL, ... )
addScattertheme properties for PlotConfiguration objects as used in function addScatter()
addLinetheme properties for PlotConfiguration objects as used in function addLine()
addRibbontheme properties for PlotConfiguration objects as used in function addRibbon()
addErrorbartheme properties for PlotConfiguration objects as used in function addErrorbar()
...theme properties for PlotConfiguration objects as used in molecule plots
A new ThemePlotConfigurations object
toJson()
Translate object into a json list
ThemePlotConfigurations$toJson()
A list that can be saved into a json file
clone()
The objects of this class are cloneable with this method.
ThemePlotConfigurations$clone(deep = FALSE)
deepWhether to make a deep clone.
List of all available tick label transformation names
TickLabelTransformsTickLabelTransforms
An object of class list of length 9.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
VerticalJustification,
tlfSettingsNames,
tlfStatFunctions
R6 class defining the configuration of a ggplot object for time profile plot
tlf::XYDataMapping -> tlf::XYGDataMapping -> tlf::RangeDataMapping -> TimeProfileDataMapping
y2AxisName of y2Axis variable to map
new()
Create a new TimeProfileDataMapping object
TimeProfileDataMapping$new( x = NULL, y = NULL, ymin = NULL, ymax = NULL, group = NULL, y2Axis = NULL, color = NULL, fill = NULL, linetype = NULL, data = NULL )
xName of x variable to map
yName of y variable to map
yminName of ymin variable to map
ymaxName of ymax variable to map
groupR6 class Grouping object or its input
y2AxisName of y2Axis variable to map
colorR6 class Grouping object or its input
fillR6 class Grouping object or its input
linetypeR6 class Grouping object or its input
datadata.frame to map used by .smartMapping
A new RangeDataMapping object
checkMapData()
Check that data variables include map variables
TimeProfileDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and legendLabels variables.
Dummy variable legendLabels is necessary to allow further modification of plots.
requireDualAxis()
Assess if data require a dual axis plot
TimeProfileDataMapping$requireDualAxis(data)
datadata.frame to check
A logical
getLeftAxis()
Render NA values for all right axis data
TimeProfileDataMapping$getLeftAxis(data)
dataA data.frame
A data.frame to be plotted in left axis
getRightAxis()
Render NA values for all left axis data
TimeProfileDataMapping$getRightAxis(data)
dataA data.frame
A data.frame to be plotted in right axis
clone()
The objects of this class are cloneable with this method.
TimeProfileDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TornadoDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for time profile plots
tlf::PlotConfiguration -> TimeProfilePlotConfiguration
lloqDirectionWhether to draw LLOQ lines for x (vertical), y (horizontal) or x and y (both).
y2AxisYAxisConfiguration object defining properties of y2-axis
new()
Create a new TimeProfilePlotConfiguration object
TimeProfilePlotConfiguration$new( ..., y2label = NULL, y2Axis = NULL, y2Scale = NULL, y2ValuesLimits = NULL, y2AxisLimits = NULL, y2Limits = lifecycle::deprecated(), lloqDirection = "horizontal", data = NULL, metaData = NULL, dataMapping = NULL )
...parameters inherited from PlotConfiguration
y2labelcharacter or Label object defining plot y2label
y2AxisYAxisConfiguration object defining y-axis properties
y2Scalename of y2-axis scale. Use enum Scaling to access predefined scales.
y2ValuesLimitsnumeric vector of length 2 defining y values limits
y2AxisLimitsnumeric vector of length 2 defining y axis limits
y2LimitslloqDirectionWhether to draw LLOQ lines for x (vertical), y (horizontal) or x and y (both).
datadata.frame used by .smartMapping
metaDatalist of information on data
dataMappingR6 class or subclass TimeProfileDataMapping
A new TimeProfilePlotConfiguration object
clone()
The objects of this class are cloneable with this method.
TimeProfilePlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
Names of the default/global settings stored in tlfEnv.
Can be used with getTLFSettings()
tlfSettingsNamestlfSettingsNames
An object of class list of length 14.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfStatFunctions
Bank of predefined functions ready to use by Aggregation methods. Bank defined as Enum. To access the function from its name, use match.fun: e.g. testFun <- match.fun("mean-1.96sd")
tlfStatFunctionstlfStatFunctions
An object of class list of length 31.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
VerticalJustification,
tlfSettingsNames
R6 class for mapping values, labels to data
tlf::XYDataMapping -> tlf::XYGDataMapping -> TornadoDataMapping
linesnumeric vector of limits to plot
sortedlogical indicating if values should be sorted
new()
Create a new TornadoDataMapping object
TornadoDataMapping$new( lines = DefaultDataMappingValues$tornado, sorted = NULL, x = NULL, y = NULL, ... )
linesnumeric vector of limits to plot
sortedlogical indicating if values should be sorted
xVariable including the values of tornado plot
yVariable including the labels of tornado plot
...parameters inherited from XYGDataMapping
A new TornadoDataMapping object
checkMapData()
Check that data variables include map variables
TornadoDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and defaultAes variables.
Dummy variable defaultAes is necessary to allow further modification of plots.
clone()
The objects of this class are cloneable with this method.
TornadoDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
XYDataMapping,
XYGDataMapping
R6 class defining the configuration of a ggplot object for tornado plots
tlf::PlotConfiguration -> TornadoPlotConfiguration
barlogical setting if tornado is uses a bar plot instead of regular points
colorPalettecolor palette property from ggplot2
dodgespace between the bars/points
defaultYScaleDefault yAxis scale value when creating a TornadoPlotConfiguration object
new()
Create a new TornadoPlotConfiguration object
TornadoPlotConfiguration$new(bar = TRUE, colorPalette = NULL, dodge = 0.5, ...)
barlogical setting if tornado is uses a bar plot instead of regular points
colorPalettecolor palette property from ggplot2
dodgespace between the bars/points
...parameters inherited from PlotConfiguration
A new TornadoPlotConfiguration object
clone()
The objects of this class are cloneable with this method.
TornadoPlotConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
XAxisConfiguration,
YAxisConfiguration
Update plot dimensions based on size and position of legend
updateExportDimensionsForLegend(plotObject)updateExportDimensionsForLegend(plotObject)
plotObject |
A |
A ggplot object
Update time profile legend caption
updateTimeProfileLegend(plotObject, caption)updateTimeProfileLegend(plotObject, caption)
plotObject |
A ggplot object |
caption |
A data.frame as obtained from |
A ggplot object
Set default Matlab theme to be used as the current default of the tlf environment
useDarkTheme()useDarkTheme()
useDarkTheme() addScatter(x = seq(1, 10), y = rnorm(10))useDarkTheme() addScatter(x = seq(1, 10), y = rnorm(10))
Set default Excel theme to be used as the current default of the tlf environment
useExcelTheme()useExcelTheme()
useExcelTheme() addScatter(x = seq(1, 10), y = rnorm(10))useExcelTheme() addScatter(x = seq(1, 10), y = rnorm(10))
Set default HighChart theme to be used as the current default of the tlf environment
useHighChartTheme()useHighChartTheme()
useHighChartTheme() addScatter(x = seq(1, 10), y = rnorm(10))useHighChartTheme() addScatter(x = seq(1, 10), y = rnorm(10))
Set default Matlab theme to be used as the current default of the tlf environment
useMatlabTheme()useMatlabTheme()
useMatlabTheme() addScatter(x = seq(1, 10), y = rnorm(10))useMatlabTheme() addScatter(x = seq(1, 10), y = rnorm(10))
Set default minimal theme to be used as the current default of the tlf environment
useMinimalTheme()useMinimalTheme()
useMinimalTheme() addScatter(x = seq(1, 10), y = rnorm(10))useMinimalTheme() addScatter(x = seq(1, 10), y = rnorm(10))
Set default theme to be used as the current default of the tlf environment
useTemplateTheme()useTemplateTheme()
useTemplateTheme() addScatter(x = seq(1, 10), y = rnorm(10))useTemplateTheme() addScatter(x = seq(1, 10), y = rnorm(10))
set the theme to be used as the current default of the tlf environment
useTheme(theme)useTheme(theme)
theme |
Theme to be used as default of the tlf environment |
List of all available vertical justifications for plot annotation text.
VerticalJustificationVerticalJustification
An object of class list of length 3.
Other enum helpers:
AestheticFields,
AestheticProperties,
AestheticSelectionKeys,
Alignments,
AtomPlots,
ColorMaps,
ColorPalettes,
DataMappings,
DefaultDataMappingValues,
Directions,
ExportFormats,
ExportUnits,
FontFaces,
HorizontalJustification,
LegendPositions,
LegendTypes,
Linetypes,
MoleculePlots,
PlotAnnotationTextSize,
PlotConfigurations,
Scaling,
Shapes,
TagPositions,
TickLabelTransforms,
tlfSettingsNames,
tlfStatFunctions
R6 class defining the configuration of X-axis
tlf::AxisConfiguration -> XAxisConfiguration
updatePlot()
Update axis configuration on a ggplot object
XAxisConfiguration$updatePlot( plotObject, yAxisLimits = NULL, ylim = lifecycle::deprecated() )
A ggplot object with updated axis properties
clone()
The objects of this class are cloneable with this method.
XAxisConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
YAxisConfiguration
R6 class for mapping x and y variable to data
xName of x variable to map
yName of y variable to map
datadata.frame used for mapping
new()
Create a new XYDataMapping object
XYDataMapping$new(x, y = NULL)
xName of x variable to map
yName of y variable to map
A new XYDataMapping object
checkMapData()
Check that data variables include map variables
XYDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and defaultAes variables.
Dummy variable defaultAes is necessary to allow further modification of plots.
clone()
The objects of this class are cloneable with this method.
XYDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYGDataMapping
R6 class for mapping x, y and GroupMapping variables to data
tlf::XYDataMapping -> XYGDataMapping
groupMappingR6 class GroupMapping object
new()
Create a new XYGDataMapping object
XYGDataMapping$new( x = NULL, y = NULL, groupMapping = NULL, color = NULL, fill = NULL, linetype = NULL, shape = NULL, size = NULL, group = NULL, data = NULL )
xName of x variable to map
yName of y variable to map
groupMappingR6 class GroupMapping object
colorR6 class Grouping object or its input
fillR6 class Grouping object or its input
linetypeR6 class Grouping object or its input
shapeR6 class Grouping object or its input
sizeR6 class Grouping object or its input
groupR6 class Grouping object or its input
datadata.frame to map used by .smartMapping
A new XYGDataMapping object
checkMapData()
Check that data variables include map variables
XYGDataMapping$checkMapData(data, metaData = NULL)
datadata.frame to check
metaDatalist containing information on data
A data.frame with map and defaultAes variables.
Dummy variable defaultAes is necessary to allow further modification of plots.
clone()
The objects of this class are cloneable with this method.
XYGDataMapping$clone(deep = FALSE)
deepWhether to make a deep clone.
Other DataMapping classes:
BoxWhiskerDataMapping,
CumulativeTimeProfileDataMapping,
DDIRatioDataMapping,
GroupMapping,
Grouping,
HistogramDataMapping,
ObsVsPredDataMapping,
ObservedDataMapping,
PKRatioDataMapping,
PieChartDataMapping,
QQDataMapping,
RangeDataMapping,
ResVsPredDataMapping,
ResVsTimeDataMapping,
TimeProfileDataMapping,
TornadoDataMapping,
XYDataMapping
R6 class defining the configuration of Y-axis
tlf::AxisConfiguration -> YAxisConfiguration
positioncharacter position of the Y-axis
updatePlot()
Update axis configuration on a ggplot object
YAxisConfiguration$updatePlot( plotObject, xAxisLimits = NULL, xlim = lifecycle::deprecated() )
A ggplot object with updated axis properties
clone()
The objects of this class are cloneable with this method.
YAxisConfiguration$clone(deep = FALSE)
deepWhether to make a deep clone.
Other PlotConfiguration classes:
AxisConfiguration,
BackgroundConfiguration,
BackgroundElement,
BoxWhiskerPlotConfiguration,
CumulativeTimeProfilePlotConfiguration,
DDIRatioPlotConfiguration,
ExportConfiguration,
HistogramPlotConfiguration,
LabelConfiguration,
LegendConfiguration,
LineElement,
ObsVsPredPlotConfiguration,
PKRatioPlotConfiguration,
PieChartPlotConfiguration,
PlotConfiguration,
PlotGridConfiguration,
QQPlotConfiguration,
ResVsPredPlotConfiguration,
ResVsTimePlotConfiguration,
TimeProfilePlotConfiguration,
TornadoPlotConfiguration,
XAxisConfiguration