Learn R Programming

dplR (version 1.6.4)

insert.ring: Edit a Ring-Width Series

Description

Insert or delete rings from a ring-width series

Usage

insert.ring(rw.vec,rw.vec.yrs=as.numeric(names(rw.vec)), year,ring.value=mean(rw.vec,na.rm=TRUE), fix.last=TRUE) delete.ring(rw.vec,rw.vec.yrs=as.numeric(names(rw.vec)), year,fix.last=TRUE)

Arguments

rw.vec
a vector of data
rw.vec.yrs
the years for rw.vec as names
year
the year to add or delete
ring.value
the value to add
fix.last
logical. If TRUE the last year of the series is fixed and the first year changes.

Value

A named vector.

Details

Simple editing of ring widths.

See Also

dplR

Examples

Run this code
data(gp.rwl)
series <- gp.rwl$"50A"
names(series) <- rownames(gp.rwl)
series <- series[!is.na(series)]
series
insert.ring(rw.vec=series,year=1950,ring.value=0)
insert.ring(rw.vec=series,year=1950,ring.value=0,fix.last=FALSE)
delete.ring(rw.vec=series,year=1900)
delete.ring(rw.vec=series,year=1900,fix.last=FALSE)

Run the code above in your browser using DataLab