Learn R Programming

Luminescence (version 0.2.4)

plot_Histogram: Plot a histogram with a separate error plot

Description

Plot a predefined histogram with an accompanying error plot as suggested by Rex Galbraith at the UK LED in Oxford 2010.

Usage

plot_Histogram(values,
               mtext,
               cex.global,
               breaks,
               se,
               rug,
               normal_curve,
               summary,
               summary.pos,
               colour,
               ...)

Arguments

values
data.frame (required): De (values[,1]) and De error (values[,2])
mtext
character (optional): further sample information (mtext)
cex.global
numeric (with default): global scaling factor
breaks
(with default): set breakpoints for histogram. Works as in hist.
se
logical (optional): plot standard error points over the histogram, default is FALSE.
rug
logical (optional): add rugs to the histogram, default is TRUE.
normal_curve
logical (with default): add a normal curve to the histogram. Mean and sd are calculated from the input data. More see details section.
summary
character (optinal): add numerical output to the plot. Can be one or more out of: "n" (number of samples), "mean" (mean De value), "median" (median of the De values), "kdemax" (maximum value of probability
summary.pos
numeric (with default): optional position coordinates for the statistical summary. Y-coordinate refers to the right hand y-axis.
colour
numeric or character(with default): optional vector of length 4 which specifies the colours of the folloqing plot items in exactly this order: histogram bars, rug lines,
...
further arguments and graphical parameters passed to plot. If y-axis labels are provided, these must be specified as a vector of length 2 since the plot features two axes (e.g. xlab = c("axis l

Value

  • Returns a plot.

Version

0.4 [2013-03-04]

Details

If the normal curve is added, the y-axis in the histogram will show the probability density.

References

Galbraith, R., 2010. Statistics in OSL: Some Current Questions; Ask Rex. Oral presentation during the UK TL/OSL/ESR Meeting at the School of Geography and the Environment, University of Oxford, 8-10 September 2010.

Galbraith, R.F. & Roberts, R.G., 2012. Statistical aspects of equivalent dose and error calculation and display in OSL dating: An overview and some recommendations. Quaternary Geochronology, 11, pp.1-27.

See Also

hist, plot

Examples

Run this code
## load data
data(ExampleData.DeValues)

## plot histogram the easiest way
plot_Histogram(ExampleData.DeValues)

## plot histogram with some more modifications
plot_Histogram(ExampleData.DeValues, 
               rug = TRUE, 
               normal_curve = TRUE, 
               cex.global = 0.9, 
               pch = 2,
               colour = c("grey", "black", "blue", "green"),
               summary = c("n", "mean", "sdrel"),
               summary.pos = c(3500, 140),
               main = "Histogram of De-values",
               mtext = "Example data set", 
               ylab = c(expression(paste(D[e], "Distribution")),
                        "Std.-err."),
               xlim = c(1800, 4000))

Run the code above in your browser using DataLab