LG_explain_plot: Explain the content of a plot

View source: R/LG_explain_plot.R

LG_explain_plotR Documentation

Explain the content of a plot

Description

This function gives information about the content of the different plots created by this package.

Usage

LG_explain_plot(
  .plot_details,
  .mode = NULL,
  .digits_for_points = 2,
  .digits_for_percentiles = 0
)

Arguments

.plot_details

This can either be a saved plot created by this package, or it can be the details-list directly. (The latter alternative is included to simplify the use of this function inside of LG_shiny.)

.mode

Specify the mode that the result will be returned in. Two modes are supported, "markdown" and "latex". The default value NULL will trigger the selection of "latex" if .plot_details is given as a saved ggplot2-object, whereas "markdown" will be selected when .plot_details is given as a list.

.digits_for_points

An integer (default value 2) that specifies the number of decimals to include when presenting the coordinates of the point corresponding to the percentiles of the coordinates. Note: A plot contains information about the coordinates of the point under investigation, but those are presented as percentiles of the standard normal distribution, and it is thus of interest to also know the actual coordinates of the point.

.digits_for_percentiles

An integer that specifies the number of decimals to include when presenting the percentiles (of the standard normal distribution) that corresponds to the point. The default value is 0.

Details

This function is used as an internal function by LG_shiny, but it can also be used when a plot is to be included in an article/presentation. In the latter case the plot must first be saved to an object, and that object can then be given to this function in the argument .plot_details. The returned text is based on the information stored in the attribute named details, and an advanced user can of course opt for a solution where the relevant information is extracted directly from details and presented according to his/hers own preferences,

Value

The returned result will be a description of the plot in .plot_details, in the mode specified by .mode.


LAJordanger/localgaussSpec documentation built on May 6, 2023, 4:31 a.m.