Learn R Programming

dplR (version 1.4.9)

write.tridas: Function to write Tree Ring Data Standard (TRiDaS) files

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 is produced by
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 chronologies per data.frame.
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 (non-integer) m
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 core, optional column three named radius givin
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
crn.types
character vector or a list of charater vectors giving the types of the derived series in crn. A single vector is interpreted as one type per data.frame in crn, recycled if not long enough.
crn.titles
optional character vector or a list of charater vectors giving the titles of the derived series in crn. The interpretation is the same as with crn.types, except that the default is to derive
crn.units
optional character vector or a list of charater vectors giving the units of the derived series in crn. The interpretation is the same as with crn.types, except that the default is to mark th
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 tridas.vocabulary
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 b
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, one i
identifier.domain
character string. The domain which the random identifiers are applicable to. Could be the URL of the organisation's server or the name of the organisation as long as it is not ambiguous. Defaults to the name of the first laborat

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
data(co021)
 write.tridas(rwl.df = co021, fname = 'tmp.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"))

Run the code above in your browser using DataLab