Learn R Programming

ISCAM (version 1.2.0)

iscamaddexp: Overlay an Exponential Density Function on Histogram

Description

addexp creates a histogram of x and overlays an exponential density function with \(\lambda = \frac{1}{mean}\).

Usage

iscamaddexp(
  x,
  main = "Histogram with exponential curve",
  xlab = deparse(substitute(x)),
  bins = NULL
)

Value

A histogram of x overlayed with an exponential density function.

Arguments

x

A numeric vector representing the data to be plotted.

main

(optional) title for the plot.

xlab

(optional) x-axis label for the plot.

bins

(optional) number of bins for the histogram.

Examples

Run this code
set.seed(0)
x <- rexp(100, rate = 0.5)
iscamaddexp(x)
iscamaddexp(x, main = "Your Active Title", xlab = "Exponential Data", bins = 20)

Run the code above in your browser using DataLab