get_hist_mcsimilation_data: Compute kernel density and histogram data, from...

Description Usage Arguments Value get_hist_mcsimilation_data get_dens_mcsimilation_data ggplot_mc_hist and ggplot_mc_dens Author(s) See Also

View source: R/get_hist_mcsimilation_data.R

Description

Take an object of class mcSimulation or a list of these and return the simulated values such that, when converted into molten data frame, can be easily understood by ggplot.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
get_dens_mcsimilation_data(
  x,
  colorQuantile = c("GRAY48", "YELLOW", "ORANGE", "DARK GREEN", "ORANGE1", "YELLOW1",
    "GRAY49"),
  colorProbability = c(1, 0.95, 0.75, 0.55, 0.45, 0.25, 0.05)
)

get_hist_mcsimilation_data(
  x,
  breaks = 100,
  colorQuantile = c("GRAY48", "YELLOW", "ORANGE", "DARK GREEN", "ORANGE1", "YELLOW1",
    "GRAY49"),
  colorProbability = c(1, 0.95, 0.75, 0.55, 0.45, 0.25, 0.05)
)

Arguments

x

mcSimulation or a list of mcSimulation

colorQuantile

character vector: encoding the colors of the quantiles defined in argument colorProbability.

colorProbability

numeric vector: defines the quantiles that shall be distinguished by the colors chosen in argument colorQuantile. Must be of the same length as colorQuantile.

breaks

one of:

  • a vector giving the breakpoints between histogram cells,

  • a function to compute the vector of breakpoints,

  • a single number giving the number of cells for the histogram,

  • a character string naming an algorithm to compute the number of cells (see ‘Details’),

  • a function to compute the number of cells.

In the last three cases the number is a suggestion only; as the breakpoints will be set to pretty values, the number is limited to 1e6 (with a warning if it was larger). If breaks is a function, the x vector is supplied to it as the only argument (and the number of breaks is only limited by the amount of available memory).

Value

get_hist_mcsimilation_data

get_hist_mcsimilation_data, which specification are made for geom_bar, takes care of extracting the simulated values as histogram from the mcSimulation object.

get_dens_mcsimilation_data

get_dens_mcsimilation_data, which specification are made for geom_density, takes care of extracting the simulated values as kernel density from the mcSimulation object.

ggplot_mc_hist and ggplot_mc_dens

These are generics for which methods are defined for mcSimulation object or a list of these.Internally, these methods rely on get_hist_mcsimilation_data and get_dens_mcsimilation_data respectively to generate the data required for geom_bar and geom_density and hand over these data to ggplot.

Author(s)

Issoufou Liman

See Also

ggplot_mc_hist get_dens_mcsimilation_data mcSimulation


Issoufou-Liman/decisionSupportExtra documentation built on Dec. 21, 2020, 6:28 p.m.