write.rwl {dplR}R Documentation

Write Tucson Format Chronology File

Description

This function writes a chronology to a Tucson (decadal) format file.

Usage

  write.rwl(rwl.df, fname, header=NULL, append=FALSE, prec=0.01)

Arguments

rwl.df a data.frame containing tree-ring ring widths with the series in columns and the years as rows. The series ids are the column names and the years are the row names. This type of data.frame is produced by read.rwl.
fname a character vector giving the file name of the rwl file.
header a list giving information for the header of the file. If NULL then no header information will be written.
append logical flag indicating whether to append this chronology to an existing file.
prec numeric indicating the precision of the output file. - This must be equal to either 0.01 or 0.001 (units are in mm).

Details

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 chronology can be written according to the International Tree Ring Data Bank (ITRDB) standard. The header information is given as a list and must be formatted with the following:
Description Name Class Max Width
Site ID site.id character 5
Site Name site.name character 52
Species Code spp.code character 4
State or Country state.country character 13
Species spp character 18
Elevation elev character or numeric 5
Latitude lat character or numeric 5
Longitude long character or numeric 5
First Year first.yr character or numeric 4
Last Year last.yr character or numeric 4
Lead Investigator lead.invs character 63
Completion Date comp.date character 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. Not that lat and long are really lat*100 or long*100 and given as integers. 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 call to write.rwl. The output from this file is suitable for publication on the ITRDB.

Value

None. Invoked for side effect (file is written).

Author(s)

Andy Bunn

See Also

write.crn, read.rwl

Examples

 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 = 2103, lat = 3712, long = -10830, first.yr = 1400, last.yr = 1963,
    lead.invs = "E. SCHULMAN",
    comp.date = "")
 write.rwl(rwl.df = co021, fname = 'tmp.rwl', header=co021.hdr,
    append=FALSE,prec=0.001)


[Package dplR version 1.1.8 Index]