View source: R/Francis_bomb_functions.R
get.nearest | R Documentation |
get.nearest
for each point (x,y), returns the x-coordinate of the
point on the line that is closest to it in the x-direction. The lie is
a linear spline defined by joining a series of poitns by straight lines.
get.nearest(line, x, y)
line |
a list, with components x and y (each an n-vector), containing the series of n points definign the line |
x, y |
- m-vectors defining m points |
Returns a vecto of lenght m. This has value NA for any point whose y value lies outside the range of the y values in the line.
Other Bomb Radiocarbon Analyses:
bias.plot.BR()
,
calc.bias()
,
calc.h()
,
closest.pt()
,
get.h.from.bias()
,
get.ref.line()
,
sim.hdist()
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) get.nearest(ref, bluenose.red$C14year, bluenose.red$C14)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.