Type: | Package |
Title: | Standardize Tracheidograms |
Version: | 0.1.1 |
Date: | 2015-11-20 |
Author: | Filipe Campelo |
Maintainer: | Filipe Campelo <fcampelo@uc.pt> |
Description: | Contains functions to standardize tracheid profiles using the traditional method (Vaganov) and a new method to standardize tracheidograms based on the relative position of tracheids within tree rings. |
Depends: | R (≥ 3.1.1) |
Imports: | tgram (≥ 0.2-2) |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
LazyData: | TRUE |
RoxygenNote: | 5.0.1 |
Packaged: | 2015-11-21 17:29:35 UTC; Dendrologia |
NeedsCompilation: | no |
Repository: | CRAN |
Date/Publication: | 2015-11-22 11:48:37 |
Compute tracheidograms
Description
This function computes a tracheidogram from microscope light measurements in gray (0-255).
Usage
getTrac(x, val50 = 120, mw = 5, scale = 1)
Arguments
x |
a vector with the light measurements (pixel gray-level values) |
val50 |
the value giving the "intensity" of the light measurements at which the measurments should be made (for more details please see the help of |
mw |
width of the rolling window to smooth the original data (for more details please see the help of |
scale |
distance per pixel, default = 1 |
Details
This function uses the tgram
function (tgram package) to convert gray pixel values (0-255) into a raw tracheidogram (keeping the original number of cells).
Value
getTrac
returns a list with following elements:
n
number of cells
pos
pos$RingWidth
gives the tree-ring width and pos$x
gives the "position" of each tracheid.
LD
a vector
with the lumen diameter (LD).
CWT
a vector
with the radial cell wall thikness (CWT).
LWratio
a vector
with the LD/CWT ratio.
References
DeSoto, L., De la Cruz, M., Fonti, P. (2011). Intra-annual patterns of tracheid size in the Mediterranean tree Juniperus thurifera as an indicator of seasonal water stress. Canadian Journal of Forest Research 41: 1280-1294. Vaganov, E., 1989. The tracheidogram method in tree-ring analysis and its application, in: Cook, E., Kairiukstis, L. (Eds.), Methods of Dendrochronology: Applications in the Environmental Sciences. Kluwer Academic Publishers, Dordrecht, The Netherlands.
See Also
tgram
Examples
## Not run:
y2010ray1 <- getTrac(tch$y2010$ray1, scale = 0.169)
y2010 <- getTrac(tch$y2010, scale = 0.169)
TCH <- lapply(tch,getTrac, scale = 0.169)
TCH$y2010$ray1$n #number of tracheids in ray1 in the year 2010
TCH$y2010$ray1$pos$RingWidth #number of tracheids in ray1 in the year 2010
#getTrac(tch$y2010$ray2, scale = 0.169)
#getTrac(data.frame(tch$y2010$ray2), scale=0.169)
## End(Not run)
Plot intra-ring variation of tracheid features (with the possibility of plotting a climatic variable)
Description
This function plots the intra-ring variation of a tracheid feature (e.g. LD, CWT or LD/CWT) along the growing season and, optionally, the intra-annual variation of a climatic variable can be added to the same plot.
Usage
ringPlot(traq, varMean = NULL, varYear = NULL, m0 = 3, mt = 6.75,
m1 = 11, type = c("LD", "CWT", "LWratio"), ylab = match.arg(type),
main = "", addGS = TRUE, addMonths = addGS, ...,
varMeanCol = "grey80", varYearCol = "red", varName = "")
Arguments
traq |
ordered sequence of a tracheid feature (e.g. LD) |
varMean |
vector with monthly values of a given environmental variable |
varYear |
vector with monlthy values of an environmental variable for a specific year |
m0 |
the start of the growing season (in months); the default value is 3 that corresponds to day of the year (doy) 60. |
mt |
the moment of transition from earlywood to latewood; the default value is 6.75. |
m1 |
the end of the growing season; default value is 11. |
type |
a string that defines the tracheid features to be plotted, defaults "LD" |
ylab |
the y axis title (for the tracheid feature variable), default value is |
main |
an overall title for the plot, if no |
addGS |
logical; if |
addMonths |
logical; if |
... |
graphical parameters for |
varMeanCol |
the default value, |
varYearCol |
the color to plot monthly environmental values; the default value is |
varName |
the y axis title (for the environmental variable),default value is |
Details
This function returns an invisible data.frame
(used to produced the graph)
Examples
## Not run:
# year 2010
y2010raw <- getTrac(tch$y2010, scale = .169)
y2010std <- tracheider(y2010raw)
par(oma = c(2,1,1,0.5))
par(mar = c(2,4,1,4))
y2010LD <- ringPlot(traq = y2010std, varMean = colMeans(sw),
varYear = sw["2010",], main=2010,type = "LD", ylim = c(0,45),
ylab = expression(paste("LD (", mu,"m)")),varName = "Soil moisture")
# year 2013
y2013raw <- getTrac(tch$y2013, scale = .169)
y2013std <- tracheider(y2013raw)
y2013LD <- ringPlot(traq = y2013std, varMean = colMeans(sw),
varYear = sw["2013",], main=2013,type = "LD", ylim = c(0,45),
ylab = expression(paste("LD (", mu,"m)")),varName = "Soil moisture")
# 2010 & 2013 in the same plot
par(mfcol = c(2,1))
par(oma = c(2,1,1,0.5))
par(mar = c(2,4,1,4))
ringPlot(y2010std, varMean = colMeans(sw), varYear = sw["2010",],
type = "LD", ylab = "", main=2010, addGS = FALSE, addMonths = FALSE)
ringPlot(y2013std, varMean = colMeans(sw), varYear = sw["2013",],
type = "LD", ylab=expression(paste("LD (", mu,"m)")),
main = 2013, addGS = TRUE, varName= "Soil moisture")
## End(not run)
Monthly soil moisture data for the period 1901-2013.
Description
A data frame with monthly soil moisture values for the period 1901-2013.
Usage
data("sw")
Format
A data.frame
with months in columns and the years as rows (1901-2013). The months are the column names and the years are the row names.
Details
...
Source
...
References
...
Examples
colMeans(sw)
plot(colMeans(sw), type="l", xlab="months", ylab="soil water")
Raw light intensity for two years (2010 and 2013) of Pinus pinaster
Description
This dataset has 2 years (2010 and 2013) each one with 3 raw profiles (in grayscale).
Usage
data("tch")
Format
A list
with 2 elements:
- a
y2010
a list with 3 radii
- a
y2013
a list with 3 radii
Details
...
Source
...
References
...
Examples
names(tch)
names(tch$y2010)
Compute standardized tracheidograms
Description
This function computes standardized tracheidograms from raw tracheidograms.
Usage
tracheider(traq, method = c("nCells", "kCells", "relPos"), k = 20)
Arguments
traq |
a raw tracheidogram (or a list of raw tracheidograms) |
method |
a |
k |
a integer to determine the number of cells of the standardized tracheidogram when |
Details
This function takes as input raw tracheidograms (obtained using the getTrac
function) and standardizes them using 3 different methods. The first method ("nCells") standardizes rays of a given ring using the mean number of cells, allowing that different rings have different number of cells. The method "kCells" normalizes tracheidograms to a constant number of tracheids (k
). The "relPos" method standardizes the tracheidogram based on the relative position of each tracheid inside the tree ring.
Value
the function tracheider
returns a list with the following elements:
LD
ordered sequence of lumen diameters.
CWT
ordered sequence of radial cell wall thikness.
LWratio
ordered sequence of LD/CWT ratio.
Examples
## Not run:
y2010 <- getTrac(tch$'y2010', scale=0.169)
y2013 <- getTrac(tch$'y2013', scale=0.169)
## nCells
y2010n <- tracheider(y2010, method = "nCells")
y2013n <- tracheider(y2013, method = "nCells")
plot(rowMeans(as.data.frame(y2010n$LD)), type="l", xlim=c(0,86),
ylim=c(0,60), yaxs="i", xaxs="i", xlab="Number of tracheid",
ylab=expression(paste("LD (", mu,"m)")), col=2, lwd=2)
lines(rowMeans(as.data.frame(y2013n$LD)), col="blue", lwd=2)
legend("topright",lty=1,lwd=2,col = c(2,4), legend=c("2010 ","2013 "),
text.col = c(2,4), box.col = "#00000000", bg="#00000000")
## k = 53
TCH <- lapply(tch, getTrac, scale=0.169)
TCHn53 <- lapply(TCH, tracheider,method = "kCells", k=53)
plot(rowMeans(as.data.frame(TCHn53$'y2010'$LD)), type="l",
xlab="Number of tracheid", ylab=expression(paste("LD (", mu,"m)")),
xlim=c(0,54), ylim=c(0,60), col=2, lwd=2, yaxs="i", xaxs="i")
lines(rowMeans(as.data.frame(TCHn53$'y2013'$LD)), col="blue", lwd=2)
legend("topright",lty=1,lwd=2,col = c(2,4),legend=c("2010 ","2013 "),
text.col = c(2,4), box.col = "#00000000", bg="#00000000")
## Relative position
TCH <- lapply(tch, getTrac, scale=0.169)
TCHrelPos <- lapply(TCH, tracheider, method ="relPos")
plot(rowMeans(as.data.frame(TCHrelPos$'y2010'$LD)),
type="l", xlim=c(0,101), ylim=c(0,60), col=2, lwd=2,
xlab="Number of tracheid", ylab=expression(paste("LD (", mu,"m)")),
yaxs="i", xaxs="i")
lines(rowMeans(as.data.frame(TCHrelPos$'y2013'$LD)),
col="blue", lwd=2)
legend("topright",lty=1,lwd=2,col = c(2,4), legend=c("2010 ","2013 "),
text.col = c(2,4), box.col = "#00000000", bg="#00000000")
## End(not run)