Learn R Programming

dplR (version 1.5.3)

write.tridas: Write Tree Ring Data Standard (TRiDaS) file

Description

This function writes measured or derived (standardized, averaged) series of values to a TRiDaS format file. Some metadata are also supported.

Usage

write.tridas(rwl.df = NULL, fname, crn = NULL, prec = NULL, ids = NULL,
    titles = NULL, crn.types = NULL, crn.titles = NULL,
    crn.units = NULL, tridas.measuring.method = NA,
    other.measuring.method = "unknown", sample.type = "core",
    wood.completeness = NULL, taxon = "",
    tridas.variable = "ring width", other.variable = NA,
    project.info = list(type = c("unknown"), description = NULL,
                        title = "", category = "", investigator = "",
                        period = ""),
    lab.info = data.frame(name = "", acronym = NA, identifier = NA,
                          domain = "", addressLine1 = NA,
                          addressLine2 = NA, cityOrTown = NA,
                          stateProvinceRegion = NA, postalCode = NA,
                          country = NA),
    research.info = data.frame(identifier = NULL, domain = NULL,
                               description = NULL),
    site.info = list(type = "unknown", description = NULL, title = ""),
    random.identifiers = FALSE, identifier.domain = lab.info$name[1],
    ...)

Arguments

rwl.df
data.frame containing tree-ring ring widths in millimetres 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
fname
character vector giving the file name of the rwl file
crn
data.frame or a list of data.frames containing tree-ring chronologies. Accepts data.frames of the type produced by chron. Additionally, allows several chro
prec
optional numeric indicating the rounding precision of the output file when writing the data contained in rwl.df. Defaults to NULL -- no rounding is done and the measurements are written in (no
ids
optional data.frame with column one named "tree" giving the numeric ID of the tree, column two named "core" giving the numeric ID of the cor
titles
optional data.frame with column one named "tree" giving the title of the tree, column two named "core" giving the title of the core, column three named "radius" giving the title of the radius
crn.types
character vector or a list of character vectors giving the types of the derived series in crn. A single vector is interpreted as one type per data.frame in
crn.titles
optional character vector or a list of character vectors giving the titles of the derived series in crn. The interpretation is the same as with crn.types,
crn.units
optional character vector or a list of character vectors giving the units of the derived series in crn. The interpretation is the same as with crn.types, e
tridas.measuring.method
character vector giving the measuring method used to acquire each series of rwl.df. Partial matching is used to replace these with the complete terms in trida
other.measuring.method
character vector giving the measuring method used to acquire each series of rwl.df. In contrast to tridas.measuring.method, these are free-form strings in English. If the vector is
sample.type
optional character vector giving the type of the samples, corresponding to "core" in ids. The length of the vector, however, must match the number of columns in rwl.df,
wood.completeness
optional data.frame giving wood completeness information for the measurement series in rwl.df. The number of rows must match the number of columns in rwl.df. The columns are expect
taxon
character string. The most detailed taxonomic name known for this element (species, genus, family etc). Preferably from the http://www.catalogueoflife.org/{Catalogue of Life} controlled vocabulary. The same string
tridas.variable
character string. Measured variable (ring width, earlywood, latewood etc) taken from the TRiDaS controlled vocabulary (tridas.vocabulary, category "variable"
other.variable
character string. Measured variable as a free-form string. The same string is used for all of rwl.df. This is only used if tridas.variable is NA.
project.info
list containing information about the project. Elements are the following (includes quotes from the TRiDaS specification):

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

lab.info
data.frame. Information about the dendrochronological research laboratories where this work was done. One row per laboratory. Defaults to one laboratory with an empty name and no other information. The columns are expected to be
research.info
optional data.frame with information about the systems in which the research project is registered. Columns are the following:

[object Object],[object Object],[object Object]

site.info
list containing information about the site (). Elements are the following, and all are character strings:

[object Object],[object Object],[object Object]

random.identifiers
logical flag. If TRUE, unique random identifiers are created with uuid.gen and attached to each (one in the file), object (site, o
identifier.domain
character string. The domain which the random identifiers are applicable to. Could be the URL of the organization's server or the name of the organization as long as it is not ambiguous. Defaults to the name
...
Unknown arguments are accepted but not used.

Value

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

References

TRiDaS - The Tree Ring Data Standard, http://www.tridas.org/

See Also

write.rwl, write.tucson, write.compact, write.crn, read.tridas

Examples

Run this code
## Write raw ring widths
data(co021)
write.tridas(rwl.df = co021, fname = "tmp1.xml", prec = 0.01,
    site.info = list(title = "Schulman old tree no. 1, Mesa Verde",
                     type = "unknown"),
    taxon = "Pseudotsuga menziesii var. menziesii (Mirb.) Franco",
    project.info = list(investigator = "E. Schulman",
                        title = "", category = "",
                        period = "", type = "unknown"))

## Write mean value chronology of detrended ring widths
data(ca533)
ca533.rwi <- detrend(rwl = ca533, method = "ModNegExp")
ca533.crn <- chron(ca533.rwi, prefix = "CAM", prewhiten = TRUE)
write.tridas(crn = ca533.crn, fname = "tmp2.xml",
    taxon = "Pinus longaeva D.K. Bailey",
    project.info =
        list(investigator = "Donald A. Graybill, V.C. LaMarche, Jr.",
             title = "Campito Mountain", category = "",
             period = "", type = "unknown"))

Run the code above in your browser using DataLab