Last data update: 2014.03.03

R: Plot Binned Histogram and ECDF Data.
PlotLog2ByteEcdfR Documentation

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.

Author(s)

Murray Stokely mstokely@google.com

See Also

histogramtools-package, hist. ecdf.

Examples

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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HistogramTools)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HistogramTools/plot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PlotLog2ByteEcdf
> ### Title: Plot Binned Histogram and ECDF Data.
> ### Aliases: PlotLog2ByteEcdf PlotLogTimeDurationEcdf
> 
> ### ** Examples
> 
> 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)
Warning message:
In xy.coords(x, y, xlabel, ylabel, log) :
  1 x value <= 0 omitted from logarithmic plot
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>