cumhist: A plot function

Description Usage Arguments Value See Also Examples

Description

This function either plots unsmoothed cumulative histogram or returns a data frame that can be used to plot such a cumulative histogram.

Usage

1
cumhist(x, plot = TRUE, type = "l", ylab = "Cumulative fraction", ...)

Arguments

x

a numeric vector.

plot

If this value is true, a plot will be generated. If false, it will return a data frame in which x is the values in the input and cdf is the cumulative fraction.

type

type of the plot. It is highly recommended not to use 'p','b' or 'o' if your data is very large. Defaults to 'l'.

ylab

ylab. Defaults to 'Cumulative fraction".

...

Additional plotting parameters.

Value

if plot=FALSE, then a data frame is returned. (see argument: plot)

See Also

ecdf (stats package)

Examples

1
2
3
4
5
6
7
8
# example 1
cumhist(rnorm(1000))

# example 2
x = cumhist(rnorm(1000),plot=FALSE)
y = cumhist(runif(1000,-2,2),plot=FALSE)
plot(x,type="l",col=1)
lines(y,col=2)

SooLee/plotosaurus documentation built on May 9, 2019, 1:52 p.m.