Learn R Programming

insurancerating (version 0.5.2)

autoplot.univ_exposure: Automatically create a ggplot for objects obtained from univariate_exposure()

Description

Takes an object produced by univariate_exposure(), and plots the exposure.

Usage

# S3 method for univ_exposure
autoplot(
  x,
  labels = TRUE,
  sort = FALSE,
  coord_flip = TRUE,
  dec.mark = ",",
  color_bg = "#E7B800"
)

Arguments

x

univ_exposure object produced by univariate_exposure()

labels

show labels with the exposure (default is TRUE)

sort

sort (or order) risk factor into descending order by exposure (default is FALSE)

coord_flip

flip cartesian coordinates so that horizontal becomes vertical, and vertical, horizontal (default is TRUE)

dec.mark

control the format of the decimal point, as well as the mark between intervals before the decimal point, choose either "," (default) or "."

color_bg

change the color of the histogram ("#E7B800" is default)

Value

a ggplot2 object

Examples

Run this code
# NOT RUN {
library(ggplot2)
x <- univariate_exposure(MTPL2, area, exposure)
autoplot(x, sort = TRUE)
autoplot(x, coord_flip = FALSE)

# }

Run the code above in your browser using DataLab