Learn R Programming

see (version 0.2.1)

how_to_plot: How to plot your object

Description

Access the source code used for plotting.

Usage

how_to_plot(x, ...)

Arguments

x

An object.

...

Arguments passed to or from other methods.

Details

The plotting-capability of the see package mainly evolve around two functions: data_plot(), which prepares the data from various objects to bring it into shape for plotting, and plot(), which takes the data from data_plot() and creates the ggplot-object. Although ggplot-objects are easily modifiable, it is sometimes necessary to build up a plot from scratch, using the data that should be plotted. This is where how_to_plot() can help. It simply extracts and polishes the code from the various plot() methods and prints it to the console. This code can be used as "basis" for building own ggplots.

Examples

Run this code
# NOT RUN {
library(bayestestR)
results <- hdi(rnorm(1000))

how_to_plot(results)
# }

Run the code above in your browser using DataLab