plot.disc: Plot a discrete distribution function

plot.discR Documentation

Plot a discrete distribution function

Description

Class disc is used to represent an arbitrary univariate discrete distribution with a finite number of support points.

Function disc creates an object of class disc, given the support points and probability values at these points.

Function plot.disc plots the discrete distribution.

Usage

## S3 method for class 'disc'
plot(
  x,
  type = c("pdf", "cdf"),
  add = FALSE,
  col = 4,
  lwd = 1,
  ylim,
  xlab = "",
  ylab = "Probability",
  ...
)

Arguments

x

an object of class disc.

type

plot its pdf or cdf.

add

add the plot or not.

col

colour to be used.

lwd, ylim, xlab, ylab

graphical parameters.

...

arguments passed on to function plot.

Author(s)

Yong Wang <yongwang@auckland.ac.nz>

See Also

disc, cnm, cnmms.

Examples


plot(disc(pt=c(0,4), pr=c(0.3,0.7)))
plot(disc(rnorm(5), 1:5))
for(i in 1:5)
   plot(disc(rnorm(5), 1:5), type="cdf", add=(i>1), xlim=c(-3,3))


nspmix documentation built on June 8, 2025, 12:29 p.m.

Related to plot.disc in nspmix...