prob_plot: Visualisation of a probability density function.

Description Usage Arguments Value

Description

A helper function to add a graph and mark an area corresponding to some probability.

Usage

1
2
prob_plot(x, y, .plot = NULL, .colour = "black", .lty = 1,
  .size = 0.7, .alpha = 0.7, .lower = NULL, .upper = NULL, ...)

Arguments

x

A vector with the values to be used along the first axis.

y

A vector with the values along the second axis.

.plot

The plot upon which additional information should be added. A new plot will be created if the default value NULL is used.

.colour

The colour-value to be used for the graph, default value "black".

.lty

The lty-value to be used for the graph, default value 1.

.size

The size-value to be used for the graph, default value 0.7.

.alpha

The alpha-value to be used for the graph, default value 0.7.

.lower

Default value NULL. To be used when a lower end of the area is desired. If this argument is NULL and an upper end is specified in .upper, then this argument will be reset to the lowest value given in x.

.upper

Default value NULL. To be used when an upper end of the area is desired. If this argument is NULL and a lower end is specified in .lower, then this argument will be reset to the highest value given in x.

...

Other arguments passed on to the plot of the area, like fill = "red", colour = "red", alpha = 0.6 or size = 0.1.

Value

A plot showing a graph (given by x and y). If at least one of .lower and .upper are different from NULL, then a shaded area representing a probability will be added too. Additional graphs/areas can be added iteratively by the help of the .plot-argument.


LAJordanger/HVLstatistikk documentation built on June 21, 2019, 7:56 p.m.