View source: R/Francis_bomb_functions.R
sim.hdist | R Documentation |
sim.hdist
Uses simulation to generate the distribution of the
statistic h, which measures how well we can expect test and reference
bomb radiocarbon data sets to agree, given the extent of sampling error
associated with each. A positive (or negative) value of h implies that
the test data is, on average, to the right (or left) of the reference
line.
sim.hdist( ref, test, nsim = 5000, diag = 0, age = "age", age.err = "age.err", cy = "catch.year", y = "C14", y.err = "C14.err", s.age = "samp.age", b.yr = "C14year" )
ref |
reference data used to develop a reference line; a data frame in which each row corresponds to one reference datum. |
test |
data frame containing the data from the species whose ages are being validated. |
nsim |
number of simulated data sets. |
diag |
integer, with possible values of 0, 1 and 2 that controls what, if any, diagnostic plots are plotted:
|
age |
TBD |
age.err |
TBD |
cy |
TBD |
y |
TBD |
y.err |
TBD |
s.age |
TBD |
b.yr |
TBD |
A dataframe with components (each with length nrow(samp)) with components X, Y - x & y coordinates of closest points - and optionally (if incl.dist = TRUE) dist - signed distance from reference curve. Optionally plots (if plot = TRUE) the data, including lines joining each sample point to its closest point.
Other Bomb Radiocarbon Analyses:
bias.plot.BR()
,
calc.bias()
,
calc.h()
,
closest.pt()
,
get.h.from.bias()
,
get.nearest()
,
get.ref.line()
data(snapper) snapper.red <- snapper[snapper$C14year >= 1955 & snapper$C14year <= 1972, ] data(bluenose) bluenose.red <- bluenose[bluenose$C14year >= 1955 & bluenose$C14year <= 1972, ] bluenose.red <- bluenose.red[bluenose.red$C14 >= -506 & bluenose.red$C14 <= 94.0, ] ref <- get.ref.line(snapper.red$C14year, snapper.red$C14) sim.hdist(ref = snapper.red, test = bluenose.red, nsim = 16, diag = 0) sim.hdist(ref = snapper.red, test = bluenose.red, nsim = 16, diag = 1) sim.hdist(ref = snapper.red, test = bluenose.red, nsim = 16, diag = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.