Read a .csv file with continuous (detrital zircon) data

Description

Reads a data table containing continuous data (e.g. detrital zircon ages)

Usage

1
2
read.distributional(fname, errorfile = NA, method = "KS",
  xlab = "age [Ma]", colmap = "rainbow")

Arguments

fname

the path of a .csv file with the input data, arranged in columns.

errorfile

the (optional) path of a .csv file with the standard errors of the input data, arranged by column in the same order as fname. Must be specified if the data are to be compared with the Sircombe-Hazelton dissimilarity.

method

an optional string specifying the dissimilarity measure which should be used for comparing this with other datasets. Should be one of either "KS" (for Kolmogorov-Smirnov) or "SH" (for Sircombe and Hazelton). If method = "SH", then errorfile should be specified. If method = "SH" and errorfile is unspecified, then the program will default back to the Kolmogorov-Smirnov dissimilarity.

xlab

an optional string specifying the nature and units of the data. This string is used to label kernel density estimates.

colmap

an optional string with the name of one of R's built-in colour palettes (e.g., heat.colors, terrain.colors, topo.colors, cm.colors), which are to be used for plotting the data.

Value

an object of class distributional, i.e. a list with the following items:

x: a named list of vectors containing the numerical data for each sample

err: an (optional) named list of vectors containing the standard errors of x

method: either "KS" (for Kolmogorov-Smirnov) or "SH" (for Sircombe Hazelton)

breaks: a vector with the locations of the histogram bin edges

xlab: a string containing the label to be given to the x-axis on all plots

Examples

1
2
3
4
agefile <- system.file("DZ.csv",package="provenance")
errfile <- system.file("DZerr.csv",package="provenance")
DZ <- read.distributional(agefile,errfile)
plot(KDE(DZ$x$N1))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.