Write Tucson Format Chronology File
This function writes a chronology to a Tucson (decadal) format file.
1 2 3
Unknown arguments are accepted but not used.
This writes a standard rwl file as defined according to the standards
of the ITRDB at
http://www.ncdc.noaa.gov/paleo/treeinfo.html. This is the
decadal or Tucson format. It is an ASCII file and machine
readable by the standard dendrochronology programs. Header information
for the rwl can be written according to the International Tree Ring
Data Bank (ITRDB) standard. The header standard is not very
reliable however and should be thought of as experimental here. Do not
try to write headers using dplR to submit to the ITRDB. When
submitting to the ITRDB, you can enter the metadata via
their website. If you insist however, the header information is given
list and must be formatted with the following:
|Site ID|| || ||5|
|Site Name|| || ||52|
|Species Code|| || ||4|
|State or Country|| || ||13|
|Species|| || ||18|
|Elevation|| || ||5|
|Latitude|| || ||5|
|Longitude|| || ||5|
|First Year|| || ||4|
|Last Year|| || ||4|
|Lead Investigator|| || ||63|
|Completion Date|| || ||8|
See examples for a correctly formatted header list. If the width of
the fields is less than the max width, then the fields will be padded
to the right length when written. Note that
long are really
lat * 100 or
long * 100 and given as integral values. E.g., 37 degrees
30 minutes would be given as 3750.
Series can be appended to the bottom of an existing file with a second
write.tucson. The output from this file is suitable for
publication on the ITRDB.
The function is capable of altering excessively long and/or duplicate series IDs to fit the Tucson specification. Additionally, characters other than numbers or English letters will be removed. If series IDs are changed, one or more warnings are shown. In that case, the user may wish to print a list of the renamings (see Arguments).
long.names = TRUE allows series IDs to
be 8 characters long, or 7 in case there are year numbers using 5
characters. Note that in the latter case the limit of 7 characters
applies to all IDs, not just the one corresponding to the
series with long year numbers. The default (
FALSE) is to allow 6 characters. Long IDs may cause
incompatibility with other software.
Andy Bunn. Patched and improved by Mikko Korpela.
1 2 3 4 5 6 7 8 9 10 11 12 13
library(utils) data(co021) co021.hdr <- list(site.id = "CO021", site.name = "SCHULMAN OLD TREE NO. 1, MESA VERDE", spp.code = "PSME", state.country = "COLORADO", spp = "DOUGLAS FIR", elev = "2103M", lat = 3712, long = -10830, first.yr = 1400, last.yr = 1963, lead.invs = "E. SCHULMAN", comp.date = "") fname <- write.tucson(rwl.df = co021, fname = tempfile(fileext=".rwl"), header = co021.hdr, append = FALSE, prec = 0.001) print(fname) # tempfile used for output unlink(fname) # remove the file
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.