Learn R Programming

HistogramTools (version 0.3.2)

PlotLog2ByteEcdf: Plot Binned Histogram and ECDF Data.

Description

Produces aesthetically pleasing ECDF plots for two common classes of non-equiwidth histograms. Specifically, (1) histograms with power of two bucket boundaries commonly used in computer science for measuring resource usage, and (2) histograms with log-scaled time duration buckets with a range from 1 second to 10 years.

Usage

PlotLog2ByteEcdf(x, xlab="Bytes (log)", ylab="Cumulative Fraction", with.grid=TRUE, ...) PlotLogTimeDurationEcdf(x, with.grid=TRUE, xlab="Age (log)", ylab="Cumulative Fraction", cex.lab=1.6, cex.axis=1.6, ...)

Arguments

x
A "histogram" object (created by hist) representing a pre-binned dataset or an "ecdf" object (created by ecdf or HistToEcdf).
xlab
x-axis label for the Ecdf plot.
ylab
y-axis label for the Ecdf plot.
with.grid
Logical. If TRUE, draw faint grid lines on the ECDF plot.
cex.lab
Graphical parameters for plot and axes.
cex.axis
Graphical parameters for plot and axes.
...
Additional parameters are passed to plot().

Details

The PlotLog2ByteEcdf function takes a "histogram" or "ecdf" which has power of 2 bucket boundaries representing bytes and creates an Ecdf plot.

The PlotLogTimeDurationEcdf function takes a "histogram" or "ecdf" with exponential bucket boundaries representing seconds of age or duration and creates an Ecdf plot.

See Also

histogramtools-package, hist. ecdf.

Examples

Run this code
filename <- system.file("unitTests/data/buildkernel-readsize-dtrace.txt",
                         package="HistogramTools")
dtrace.hists <- ReadHistogramsFromDtraceOutputFile(filename)
x <- SubsetHistogram(dtrace.hists[["TOTAL"]], minbreak=1)
PlotLog2ByteEcdf(x, cex.lab=1.4)

x <- rexp(100000)
x <- x*(86400*300)/diff(range(x))

n <- as.integer(1+log2(max(x)))

h <- hist(x, breaks=c(0, unique(as.integer(2^seq(from=0, to=n, by=.25)))))
PlotLogTimeDurationEcdf(h)

Run the code above in your browser using DataLab