plot_pmf: Plot Probability Mass Function Values

View source: R/helpers.R

plot_pmfR Documentation

Plot Probability Mass Function Values

Description

Plot Probability Mass Function Values

Usage

plot_pmf(x, y, ..., col = "grey", add = FALSE)

Arguments

x

values

y

probability mass values y = f(x)

...

passed to plot() and rect()

col

Fill color of bars.

add

Add bars to existing plot.

Plots the probability values as a barplot.

Value

No return value, this function generates a plot in the current graphics device.

Examples

x <- seq(0, 5)
y <- dpois(x, lambda = 2)
plot_pmf(x, y)

psborrow2 documentation built on April 4, 2025, 12:37 a.m.