Learn R Programming

HistDAWass (version 1.0.4)

plot-distributionH: plot for a distributionH object

Description

A plot function for a distributionH object. The function returns a representation of the histogram.

Usage

# S4 method for distributionH
plot(x, type = "HISTO", col = "green", border = "black")

Arguments

x

a distributionH object

type

(optional) a string describing the type of plot, default="HISTO". Other allowed types are "CDF"=Cumulative distribution function, "QF"= quantile function, "DENS"=a density approximation, "HBOXPLOT"=horizontal boxplot, "VBOXPLOT"= vertical boxplot,

col

(optional) a string the color of the plot, default="green".

border

(optional) a string the color of the border of the plot, default="black".

Examples

Run this code
# NOT RUN {
##---- initialize a distributionH
 mydist<-distributionH(x=c(7,8,10,15),p=c(0, 0.2, 0.7, 1))
 # show the histogram
 plot(mydist) #plots mydist
 plot(mydist, type="HISTO", col="red", border="blue") #plots mydist
 plot(mydist, type="DENS", col="red", border="blue") #plots a density approximation for mydist
 plot(mydist, type="HBOXPLOT") #plots a horizontal boxplot for mydist
 plot(mydist, type="VBOXPLOT") #plots a vertical boxplot for mydist
 plot(mydist, type="CDF") #plots the cumulative distribution function of mydist
 plot(mydist, type="QF") #plots the quantile function of mydist
# }

Run the code above in your browser using DataLab