library(utils)
data(ca533)
ca533.rwi <- detrend(rwl = ca533, method = "ModNegExp")
ca533.crn <- chron(ca533.rwi)
fname1 <- write.crn(ca533.crn, tempfile(fileext=".crn"))
print(fname1) # tempfile used for output
## Put the standard and residual chronologies in a single file
## with ITRDB header info on top. Not recommended.
ca533.crn <- chron(ca533.rwi, prewhiten = TRUE)
ca533.hdr <- list(site.id = "CAM", site.name = "Campito Mountain",
spp.code = "PILO", state.country = "California",
spp = "Bristlecone Pine", elev = "3400M", lat = 3730,
long = -11813, first.yr = 626, last.yr = 1983,
lead.invs = "Donald A. Graybill, V.C. LaMarche, Jr.",
comp.date = "Nov1983")
fname2 <- write.crn(ca533.crn[, -2], tempfile(fileext=".crn"),
header = ca533.hdr)
write.crn(ca533.crn[, -1], fname2, append = TRUE)
print(fname2) # tempfile used for output
unlink(c(fname1, fname2)) # remove the files
Run the code above in your browser using DataLab