This function reads in a TRiDaS format XML file. Measurements, derived series and various kinds of metadata are supported.
read.tridas(fname, ids.from.titles = FALSE,
ids.from.identifiers = TRUE, combine.series = TRUE,
trim.whitespace = TRUE, warn.units = TRUE)
A list with a variable number of components according to the contents of the input file. The possible list components are:
A data.frame
or a list of data.frame
s with
the series in columns and the years as rows. Contains measurements
(<measurementSeries>) with known years. The series
IDs are the column names and the years are the row
names. The series IDs are derived from <title>
elements in the input file. Each unique combination of
<project>, <object>, <unit>, <taxon>,
and <variable> gets a separate data.frame
.
A data.frame
or a list of data.frame
s with columns
named "tree"
, "core"
, "radius"
, and
"measurement"
, together giving a unique numeric
ID
for each column of the data.frame
(s) in
measurements
.
If !combine.series && (ids.from.titles || ids.from.identifiers)
, some rows may be non-unique.
A data.frame
or a list of data.frame
s with
columns named "tree"
, "core"
, "radius"
, and
"measurement"
, containing the <title> hierarchy of
each column of the data.frame
(s) in measurements
.
A data.frame
or a list of data.frame
s
containing wood completeness information. Column names are a subset
of the following, almost self-explanatory set:
"pith.presence"
, "heartwood.presence"
,
"sapwood.presence"
,
"last.ring.presence"
, "last.ring.details"
,
"bark.presence"
,
"n.sapwood"
, "n.missing.heartwood"
,
"n.missing.sapwood"
,
"missing.heartwood.foundation"
,
"missing.sapwood.foundation"
,
"n.unmeasured.inner"
, "n.unmeasured.outer"
.
A character
vector giving the unit of the
measurements. Length equals the number of data.frame
s in
measurements
.
A numeric
vector giving the project
ID, i.e. the position of the corresponding
<project> element), of the measurements in each
data.frame
in measurements
. Length equals the
number of data.frame
s.
A character
vector giving the title of the
project of each data.frame
in measurements
.
Length equals the number of data.frame
s.
A data.frame
giving the site ID
(position of <object> element(s) within a <project>)
of each data.frame
in measurements
. May have
several columns to reflect the possibly nested <object>
elements.
A data.frame
giving the site
(<object>) title of each data.frame
in
measurements
. May have several columns to reflect the
possibly nested <object> elements.
A data.frame
showing the taxonomic name for each
data.frame
in measurements
. Contains some of
the following columns: "text"
, "lang"
,
"normal"
, "normalId"
, "normalStd"
. The first
two are a free-form name and its language, and the rest are related
to a normalized name.
A data.frame
showing the measured variable of
each data.frame
in measurements
. Contains some
of the following columns: "text"
, "lang"
,
"normal"
, "normalId"
, "normalStd"
,
"normalTridas"
. The first two are a free-form name and its
language, and the rest are related to a normalized name.
A list
of measurements with unknown years,
together with metadata. Elements are a subset of the following:
A numeric
vector or a list of such vectors
containing measurement series
A character
vector giving the unit of the
measurements. Length equals the number of measurement series in
undated$data
A data.frame
with columns named "tree"
,
"core"
, "radius"
, and "measurement"
,
together giving a numeric
ID for each measurement
series in undated$data
. The rows are
guaranteed to be unique only when comparing measurement series
with the same project.id
and site.id
,
but not if ids.from.titles ||
ids.from.identifiers
.
A data.frame
with columns named
"tree"
, "core"
, "radius"
, and
"measurement"
, containing the <title> hierarchy of
each measurement series in undated$data
A numeric
vector giving the project
ID of each measurement series in
undated$data
A character
vector giving the project
title of each measurement series in
undated$data
A data.frame
giving the site ID of
each measurement series in undated$data
A data.frame
giving the site title of
each measurement series in undated$data
A data.frame
containing the variable of
each measurement series in undated$data
A data.frame
containing taxonomic names of
each measurement series in undated$data
A data.frame
containing wood
completeness information of each measurement series in
undated$data
A list
of calculated series of values, together
with metadata. Elements are a subset of the following:
A numeric
vector or a list of such vectors
containing calculated series of values.
A list
of data.frame
s, one for each
series in derived$data
, giving links to the
measurements used to form the corresponding derived series.
Each data.frame
has a subset of the following columns:
"idRef"
(reference to a series in the same file),
"xLink"
(URI), "identifier"
, and
"domain"
(identifier and its domain, not necessarily in
the same file).
A numeric
vector giving the project
ID of each derived series in
derived$data
A numeric
vector giving the ID (order
of appearance in the project) of each derived series in
derived$data
A character
vector giving the title of each
derived series in derived$data
A character
vector giving the project
title of each derived series in derived$data
A character
vector giving the unit of the
derived series. Length equals the number of series in
derived$data
.
A character
vector giving the
standardizing method of the derived series. Length equals the
number of series in derived$data
.
A data.frame
containing the variable of
each series in derived$data
A data.frame
containing the type of various
entities, and metadata related to each type element.
Contents are NA
where the metadata is not applicable (e.g.,
no tree.id
when the type element refers to a
project). Columns are a subset of the following:
The text of the type element
The language of the text
The normalized name of the type
The ID value of the type in the standard dictionary
The name of the standard
The ID of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the ID of the site where the <type> element appeared.
The ID of the tree
The ID of the core
The ID of the derived series
The title of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the title of the site where the <type> element appeared.
The title of the tree
The title of the core
The title of the derived series
A data.frame
containing comments to various
entities, and metadata related to each comments element.
Contents are NA
where the metadata is not applicable. Columns
are a subset of the following:
The text of the comments element
The ID of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the ID of the site.
The ID of the tree
The ID of the core
The ID of the radius
The ID of the measurement series
The ID of the derived series
The title of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the title of the site.
The title of the tree
The title of the core
The title of the radius
The title of the measurement series
The title of the derived series
A data.frame
containing identifiers of
various entities, and metadata related to each identifier
element. Contents are NA
where the metadata is not
applicable. Columns are a subset of the following:
The text of the identifier element
The domain which the identifier is applicable to
The ID of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the ID of the site.
The ID of the tree
The ID of the core
The ID of the radius
The ID of the measurement series
The ID of the derived series
The title of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the title of the site.
The title of the tree
The title of the core
The title of the radius
The title of the measurement series
The title of the derived series
A list
of remarks concerning individual measured
or derived values, with some of the following items:
Remarks related to measurements with a known
year. A data.frame
with the following columns:
The remark
Index to a data.frame
in
measurements
Index to a row of the data.frame
Index to a column of the data.frame
Remarks related to measurements without a known
year. A data.frame
with the following columns:
The remark
Index to a series in
undated$data
Index to a value in the series
Remarks related to derived values. A
data.frame
with the following columns:
The remark
Index to a series in
derived$data
Index to a value in the series
A data.frame
or a list
of
data.frame
s with one item per project. Each
data.frame
contains information about the research
laboratories involved in the project. Columns are a subset of the
following:
Name of the laboratory
Acronym of the name
Identifier
Domain which the identifier is applicable to
Address
Another address line
City or town
State, province or region
Postal code
Country
A data.frame
or a list
of
data.frame
s with one item per project. Each
data.frame
contains information about the systems in which
the research project is registered. Columns are the following:
Identifier
Domain which the identifier is applicable to
General description
A data.frame
containing the altitude of
trees. Columns are the following:
The altitude in metres
The ID of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the ID of the site.
The ID of the tree
The title of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the title of the site.
The title of the tree
A data.frame
containing links to preferred
measurement series. Columns are a subset of the following:
Reference to a series in the same file
URI
Identifier of a series not necessarily in the same file
Domain which the identifier is applicable to
The ID of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the ID of the site.
The ID of the tree
The title of the project
One or more columns with this prefix, depending on the maximum depth of the <object> hierarchy. Gives the title of the site.
The title of the tree
character
vector giving the file name of the
TRiDaS file.
logical
flag indicating whether to
override the (tree, core, radius, measurement) structure imposed by
the element hierarchy (element, sample, radius, measurementSeries)
of the file. If TRUE
, measurement series will be rearranged
by matching titles in the file at the aforementioned four levels of
the hierarchy. Defaults to FALSE
, i.e. the element hierarchy
of the file will be used.
logical
flag indicating whether to
(partially) override the element hierarchy of the file. If
TRUE
, measurement series will be grouped according to
matching identifiers at the measurementSeries level, where
identifiers are available. The changes caused by this option are
applied on top of the structure imposed by the file or computed from
matching titles if ids.from.titles == TRUE
. Defaults
to TRUE
.
logical
flag indicating whether to
combine two or more measurement series with the same set of (tree,
core, radius, measurement) ID numbers. Each set of
combined measurement series will be represented by one column of a
resulting data.frame
. Overlapping years of combined series do not
produce a warning. If several data points are available for a given
year, the function chooses one in a rather arbitrary manner. This
option can only have effect when ids.from.titles ||
ids.from.identifiers
.
logical
flag indicating whether to
replace repeated white spaces in the text content of the file with
only one space. Defaults to TRUE
, i.e. excess white space
will be trimmed from the text.
logical
flag indicating whether to warn
about unitless measurements and “strange” units. The
function expects measurements in units that can be converted to
millimetres. Defaults to TRUE
: warnings will be given. For
example, density measurements will trigger warnings, which can be
disabled by setting this option to FALSE
.
Mikko Korpela
The Tree Ring Data Standard (TRiDaS) is described in Jansma et. al (2010).
The parameters used for rearranging (ids.from.titles
,
ids.from.identifiers
) and combining
(combine.series
) measurement series only affect the four
lowest levels of document structure: element, sample, radius,
measurementSeries. Series are not reorganized or combined at the
upper structural levels (project, object).
Jansma, E., Brewer, P. W., and Zandhuis, I. (2010) TRiDaS 1.1: The tree-ring data standard. Dendrochronologia, 28(2), 99--130.
read.rwl
, read.tucson
,
read.compact
, read.fh
,
write.tridas