[Dplr-commits] r808 - in pkg/dplR: . R man vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 10 18:09:07 CEST 2014
Author: andybunn
Date: 2014-04-10 18:09:06 +0200 (Thu, 10 Apr 2014)
New Revision: 808
Modified:
pkg/dplR/R/crn.plot.R
pkg/dplR/R/rwl.stats.R
pkg/dplR/TODO
pkg/dplR/man/anos1.Rd
pkg/dplR/man/ca533.Rd
pkg/dplR/man/cana157.Rd
pkg/dplR/man/chron.Rd
pkg/dplR/man/co021.Rd
pkg/dplR/man/crn.plot.Rd
pkg/dplR/man/detrend.series.Rd
pkg/dplR/man/ffcsaps.Rd
pkg/dplR/man/gp.d2pith.Rd
pkg/dplR/man/gp.dbh.Rd
pkg/dplR/man/gp.po.Rd
pkg/dplR/man/gp.rwl.Rd
pkg/dplR/man/rwl.stats.Rd
pkg/dplR/man/seg.plot.Rd
pkg/dplR/man/spag.plot.Rd
pkg/dplR/vignettes/intro-dplR.Rnw
Log:
* Various english usage typos corrected (that had been pointed out from Mikko - thanks!): E.g., an rwl -> a rwl. Dataset to data set. And so on.
* Generic methods for rwl.stats and crn.plot reverted for backwards compatability.
* Some other light help and vignette edits.
Modified: pkg/dplR/R/crn.plot.R
===================================================================
--- pkg/dplR/R/crn.plot.R 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/R/crn.plot.R 2014-04-10 16:09:06 UTC (rev 808)
@@ -1,6 +1,6 @@
-`plot.crn` <- function(x, ...){ crn.plot(x, ...) }
+`plot.crn` <- function(x, ...){ crn.plot(crn=x, ...) }
-`crn.plot` <- function(x, add.spline=FALSE, nyrs=NULL, f=0.5,
+`crn.plot` <- function(crn, add.spline=FALSE, nyrs=NULL, f=0.5,
crn.line.col='grey50',
spline.line.col='red',
samp.depth.col='grey90',
@@ -9,7 +9,6 @@
abline.pos=1, abline.col='black',
abline.lty=1, abline.lwd=1,
...) {
- crn <- x
if(!is.data.frame(crn)) stop("'crn' must be a data.frame")
op <- par(no.readonly=TRUE) # Save par
Modified: pkg/dplR/R/rwl.stats.R
===================================================================
--- pkg/dplR/R/rwl.stats.R 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/R/rwl.stats.R 2014-04-10 16:09:06 UTC (rev 808)
@@ -1,7 +1,7 @@
-`summary.rwl` <- function(object,...){ rwl.stats(object) }
+`summary.rwl` <- function(object,...){ rwl.stats(rwl=object) }
`rwl.stats` <-
- function(object)
+ function(rwl)
{
acf1 <- function(x){
ar1 <- acf(x[!is.na(x)], lag.max=1, plot=FALSE)
@@ -12,20 +12,20 @@
sum((y-mean(y))^3) / (length(y)*sd(y)^3)
}
- yr <- as.numeric(row.names(object))
- series.stats <- data.frame(series=names(object))
- the.range <- as.matrix(apply(object, 2, yr.range, yr.vec=yr))
+ yr <- as.numeric(row.names(rwl))
+ series.stats <- data.frame(series=names(rwl))
+ the.range <- as.matrix(apply(rwl, 2, yr.range, yr.vec=yr))
series.stats$first <- the.range[1, ]
series.stats$last <- the.range[2, ]
series.stats$year <- series.stats$last - series.stats$first + 1
- series.stats$mean <- colMeans(object, na.rm=TRUE)
- series.stats$median <- apply(object, 2, median, na.rm=TRUE)
- series.stats$stdev <- apply(object, 2, sd, na.rm=TRUE)
- series.stats$skew <- apply(object, 2, skew)
- series.stats$sens1 <- apply(object, 2, sens1)
- series.stats$sens2 <- apply(object, 2, sens2)
- series.stats$gini <- apply(object, 2, gini.coef)
- series.stats$ar1 <- apply(object, 2, acf1)
+ series.stats$mean <- colMeans(rwl, na.rm=TRUE)
+ series.stats$median <- apply(rwl, 2, median, na.rm=TRUE)
+ series.stats$stdev <- apply(rwl, 2, sd, na.rm=TRUE)
+ series.stats$skew <- apply(rwl, 2, skew)
+ series.stats$sens1 <- apply(rwl, 2, sens1)
+ series.stats$sens2 <- apply(rwl, 2, sens2)
+ series.stats$gini <- apply(rwl, 2, gini.coef)
+ series.stats$ar1 <- apply(rwl, 2, acf1)
seq.temp <- -seq_len(4)
series.stats[, seq.temp] <- round(series.stats[, seq.temp], 3)
Modified: pkg/dplR/TODO
===================================================================
--- pkg/dplR/TODO 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/TODO 2014-04-10 16:09:06 UTC (rev 808)
@@ -12,25 +12,3 @@
class('crn'). There is a plot method now. What else?
- Related: Consider the benefits and drawbacks of creating classes for rwi.
-
-o [andybunn] Keep old argument names for backward compatibility?
- Users may call the affected functions with named arguments. The
- (wrapper) method for the generic function must use the argument
- name of the generic, but the actual function, familiar to users of
- previous versions of dplR, should arguably use the old name.
-
-- crn.plot (plot.crn): crn vs x
-
-- rwl.stats (summary.rwl): rwl vs object
-
-o [andybunn] Vignette: Which article, a or an, for rwl? Now both are used.
- Is rwl read as "ring width length", so should it be "a"?
-
-o [andybunn] Vignette: Check that rbar.tot is correct.
- In "This number is typically higher than rbar.tot", there used to
- be rbar instead of rbar.tot. I (Mikko) tried to be more explicit
- about which number should be compared. Please check that this makes
- sense.
-
-o [andybunn] Vignette: Use either "dataset" or "data set" exclusively.
- The former is used more often in .Rd files of the package.
Modified: pkg/dplR/man/anos1.Rd
===================================================================
--- pkg/dplR/man/anos1.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/anos1.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -3,9 +3,9 @@
\alias{anos1}
\title{Rothenburg Tree Ring Widths}
\description{
- This dataset gives the raw ring widths for Norway spruce \emph{Picea
+ This data set gives the raw ring widths for Norway spruce \emph{Picea
abies} at Rothenburg ob der Tauber, Bavaria, Germany. There are 20
- series from 10 trees. Dataset was created using
+ series from 10 trees. Data set was created using
\code{\link{read.rwl}} and saved to an .rda file using
\code{\link[base]{save}}.
}
Modified: pkg/dplR/man/ca533.Rd
===================================================================
--- pkg/dplR/man/ca533.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/ca533.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -3,9 +3,9 @@
\alias{ca533}
\title{Campito Mountain Tree Ring Widths}
\description{
- This dataset gives the raw ring widths for bristlecone pine
+ This data set gives the raw ring widths for bristlecone pine
\emph{Pinus longaeva} at Campito Mountain in California,
- \acronym{USA}. There are 34 series. Dataset was created using
+ \acronym{USA}. There are 34 series. Data set was created using
\code{\link{read.rwl}} and saved to an .rda file using
\code{\link{save}}.
}
Modified: pkg/dplR/man/cana157.Rd
===================================================================
--- pkg/dplR/man/cana157.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/cana157.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -3,9 +3,9 @@
\alias{cana157}
\title{Twisted Tree Heartrot Hill Standard Chronology}
\description{
- This dataset gives the standard chronology for white spruce
+ This data set gives the standard chronology for white spruce
\emph{Picea glauca} at Twisted Tree Heartrot Hill in Yukon,
- Canada. Dataset was created using \code{\link{read.crn}} and saved to
+ Canada. Data set was created using \code{\link{read.crn}} and saved to
an .rda file using \code{\link{save}}.
}
\usage{data(cana157)}
Modified: pkg/dplR/man/chron.Rd
===================================================================
--- pkg/dplR/man/chron.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/chron.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -40,11 +40,12 @@
}
\author{ Andy Bunn. Patched and improved by Mikko Korpela. }
\seealso{ \code{\link{read.rwl}}, \code{\link{detrend}},
- \code{\link{ar}}, \code{\link{chron}}
+ \code{\link{ar}}, \code{\link{crn.plot}}
}
\examples{data(ca533)
ca533.rwi <- detrend(rwl = ca533, method = "ModNegExp")
ca533.crn <- chron(ca533.rwi, prefix = "CAM")
+plot(ca533.crn,xlab="Year",ylab="RWI")
## With residual chron
ca533.crn <- chron(ca533.rwi, prefix = "CAM", prewhiten = TRUE)
}
Modified: pkg/dplR/man/co021.Rd
===================================================================
--- pkg/dplR/man/co021.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/co021.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -3,9 +3,9 @@
\alias{co021}
\title{Schulman Old Tree No. 1, Mesa Verde}
\description{
- This dataset gives the raw ring widths for Douglas fir
+ This data set gives the raw ring widths for Douglas fir
\emph{Pseudotsuga menziesii} at Mesa Verde in Colorado, \acronym{USA}.
- There are 35 series. Dataset was created using \code{\link{read.rwl}}
+ There are 35 series. Data set was created using \code{\link{read.rwl}}
and saved to an .rda file using \code{\link{save}}.
}
\usage{data(co021)}
Modified: pkg/dplR/man/crn.plot.Rd
===================================================================
--- pkg/dplR/man/crn.plot.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/crn.plot.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -7,7 +7,7 @@
\code{data.frame} of the type produced by \code{\link{chron}}.
}
\usage{
-crn.plot(x, add.spline = FALSE, nyrs = NULL, f = 0.5,
+crn.plot(crn, add.spline = FALSE, nyrs = NULL, f = 0.5,
crn.line.col='grey50',spline.line.col='red',
samp.depth.col='grey90',
samp.depth.border.col='grey80',
@@ -19,35 +19,35 @@
}
\arguments{
- \item{x}{ a \code{data.frame} as produced by
+ \item{x, crn}{ a \code{data.frame} e.g., as produced by
\code{\link{chron}}. The \code{data.frame} should have the years in
- \code{rownames(\var{x})}, the chronologies in the columns.
+ \code{rownames(\var{crn})}, the chronologies in the columns.
Optionally, the last column can contain the sample depth named
- \code{"samp.depth"}. }
+ \code{"samp.depth"}. If the data are produced via \code{\link{chron}}
+ the object will be of class "crn" and the generic plot method can be used }
\item{add.spline}{ a \code{logical} flag. Will add a line with a
- smoothing spline. }
+ smoothing spline using \code{\link{ffcsaps} } }
\item{nyrs}{ a number giving the rigidity of the smoothing spline.
Defaults to 0.33 times the length of the first chronology if
- \code{\var{nyrs}} is \code{NULL}. }
+ \code{\var{nyrs}} is \code{NULL} }
\item{f}{ a number between 0 and 1 giving the frequency response or
- wavelength cutoff. Defaults to 0.5. }
+ wavelength cutoff. Defaults to 0.5 }
\item{crn.line.col}{ color for the x line }
\item{spline.line.col}{ color for the spline (if added) }
\item{samp.depth.col}{ color for the sample depth polygon (if present) }
\item{samp.depth.border.col}{ border color for the sample depth
- polygon (if present)}
- \item{crn.lwd}{ line width for the x line}
+ polygon (if present) }
+ \item{crn.lwd}{ line width for the x line }
\item{spline.lwd}{ line width for the spline (if added) }
\item{abline.pos}{ position for a refernce abline on the y-axis.
No line added if NULL }
\item{abline.col}{ color for the reference abline (if added) }
\item{abline.lty}{ line type the reference abline (if added) }
\item{abline.lwd}{ line width for the reference abline (if added)}
- \item{\dots}{ Additional arguments from the generic function to pass to
- \code{\link{plot}}. }
+ \item{\dots}{ Additional arguments to pass to \code{\link{plot}} }
}
\details{
- This makes a simple plot of one or more tree-ring chronologies.
+ This makes a plot of one or more tree-ring chronologies.
}
\value{
None. Invoked for side effect (plot).
Modified: pkg/dplR/man/detrend.series.Rd
===================================================================
--- pkg/dplR/man/detrend.series.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/detrend.series.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -129,7 +129,7 @@
noise <- c(arima.sim(model = list(ar = 0.7), n = 200, mean = 1, sd = 0.5))
series <- gt * noise
series.rwi <- detrend.series(y = series, y.name = "Foo")
-## Use series CAM011 from the Campito dataset
+## Use series CAM011 from the Campito data set
data(ca533)
series <- ca533[, "CAM011"]
names(series) <- rownames(ca533)
Modified: pkg/dplR/man/ffcsaps.Rd
===================================================================
--- pkg/dplR/man/ffcsaps.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/ffcsaps.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -50,7 +50,7 @@
\examples{
\dontrun{
library(graphics)
-## Use series CAM011 from the Campito dataset
+## Use series CAM011 from the Campito data set
data(ca533)
series <- ca533[, "CAM011"]
series <- series[!is.na(series)]
@@ -59,7 +59,7 @@
lines(ffcsaps(series, nyrs = 64), col = "green", lwd = 2)
lines(ffcsaps(series, nyrs = 128), col = "blue", lwd = 2)
}
-## Use first series from the Mesa Verde dataset
+## Use first series from the Mesa Verde data set
data(co021)
series <- co021[, 1]
series <- series[!is.na(series)]
Modified: pkg/dplR/man/gp.d2pith.Rd
===================================================================
--- pkg/dplR/man/gp.d2pith.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/gp.d2pith.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -3,8 +3,8 @@
\alias{gp.d2pith}
\title{ Ponderosa Pine Distance to Pith Corresponding to \code{\link{gp.rwl}} }
\description{
- This dataset gives the distance to pith for each series (in mm) that
- matches the ring widths for \code{\link{gp.rwl}} - a dataset of
+ This data set gives the distance to pith for each series (in mm) that
+ matches the ring widths for \code{\link{gp.rwl}} - a data set of
ponderosa pine (\emph{Pinus ponderosa}) from the Gus Pearson Natural
Area (\acronym{GPNA}) in northern Arizona, \acronym{USA}. Data are
further described by Biondi and Qeadan (2008) and references therein.
Modified: pkg/dplR/man/gp.dbh.Rd
===================================================================
--- pkg/dplR/man/gp.dbh.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/gp.dbh.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -3,8 +3,8 @@
\alias{gp.dbh}
\title{ Ponderosa Pine Stem Diameters and Bark Thickness (\code{\link{gp.rwl}}) }
\description{
- This dataset gives the diameter at breast height for each series that
- matches the series in \code{\link{gp.rwl}} - a dataset of ponderosa
+ This data set gives the diameter at breast height for each series that
+ matches the series in \code{\link{gp.rwl}} - a data set of ponderosa
pine (\emph{Pinus ponderosa}) from the Gus Pearson Natural Area
(\acronym{GPNA}) in northern Arizona, \acronym{USA}. Data are further
described by Biondi and Qeadan (2008) and references therein.
Modified: pkg/dplR/man/gp.po.Rd
===================================================================
--- pkg/dplR/man/gp.po.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/gp.po.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -3,8 +3,8 @@
\alias{gp.po}
\title{ Ponderosa Pine Pith Offsets Corresponding to \code{\link{gp.rwl}} }
\description{
- This dataset gives the pith offsets that match the ring widths for
- \code{\link{gp.rwl}} - a dataset of ponderosa pine (\emph{Pinus
+ This data set gives the pith offsets that match the ring widths for
+ \code{\link{gp.rwl}} - a data set of ponderosa pine (\emph{Pinus
ponderosa}) from the Gus Pearson Natural Area (\acronym{GPNA}) in
northern Arizona, \acronym{USA}. Data are further described by Biondi
and Qeadan (2008) and references therein.
Modified: pkg/dplR/man/gp.rwl.Rd
===================================================================
--- pkg/dplR/man/gp.rwl.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/gp.rwl.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -3,7 +3,7 @@
\alias{gp.rwl}
\title{ Ponderosa Pine Ring Widths from Gus Pearson Natural Area }
\description{
- This dataset includes ring-width measurements for ponderosa pine
+ This data set includes ring-width measurements for ponderosa pine
(\emph{Pinus ponderosa}) increment cores collected at the Gus Pearson
Natural Area (\acronym{GPNA}) in northern Arizona,
\acronym{USA}. There are 58 series from 29 trees (2 cores per
Modified: pkg/dplR/man/rwl.stats.Rd
===================================================================
--- pkg/dplR/man/rwl.stats.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/rwl.stats.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -7,14 +7,14 @@
of raw or detrended ring-width series.
}
\usage{
-rwl.stats(object)
+rwl.stats(rwl)
\method{summary}{rwl}(object, ...)
}
\arguments{
- \item{object}{ a \code{rwl} object with (usually) raw ring-width series
+ \item{rwl, object}{ a \code{rwl} object with (usually) raw ring-width series
as columns and years as rows such as that produced by
\code{\link{read.rwl}}. It is sometimes desirable to run this on
detrended (e.g., rwi) data. }
Modified: pkg/dplR/man/seg.plot.Rd
===================================================================
--- pkg/dplR/man/seg.plot.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/seg.plot.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -14,7 +14,7 @@
}
\details{
This makes a simple plot of the length of each series in a tree-ring
- dataset.
+ data set.
}
\value{
None. This function is invoked for its side effect, which is to
Modified: pkg/dplR/man/spag.plot.Rd
===================================================================
--- pkg/dplR/man/spag.plot.Rd 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/man/spag.plot.Rd 2014-04-10 16:09:06 UTC (rev 808)
@@ -15,7 +15,7 @@
\item{\dots}{ arguments to be passed to \code{\link{lines}}. }
}
\details{
- This makes a simple plot of each series in a tree-ring dataset. Each
+ This makes a simple plot of each series in a tree-ring data set. Each
series is centered first by subtracting the column mean using
\code{\link{scale}}. The plot can be grossly tuned with
\code{\var{zfac}} which is a multiplier to \code{\var{rwl}} before
Modified: pkg/dplR/vignettes/intro-dplR.Rnw
===================================================================
--- pkg/dplR/vignettes/intro-dplR.Rnw 2014-04-10 15:08:09 UTC (rev 807)
+++ pkg/dplR/vignettes/intro-dplR.Rnw 2014-04-10 16:09:06 UTC (rev 808)
@@ -88,7 +88,7 @@
\subsection{Describing and Plotting Ring-Width Data}
Once a \code{rwl} data set has been read into R, there are a variety of ways to
-describe and visualize those data. For instance, we can plot an \code{rwl}
+describe and visualize those data. For instance, we can plot a \code{rwl}
object by showing either the segments arranged over time as straight lines or
as a ``spaghetti plot.'' The \code{rwl} objects have a generic S3 method for
\code{plot} and \code{summary}. See Figure~\ref{fig:rwl.plot}.
@@ -203,7 +203,7 @@
\section{Descriptive Statistics}
Either before or after standardization, it would be natural to want to look at
-some common (and not-so common) descriptive statistics of an \code{rwl} object. The
+some common (and not-so common) descriptive statistics of a \code{rwl} object. The
\code{rwl.stats} function is typically used on raw ring widths
(the \code{rwl} object) and produces summary statistics. Here are summary
statistics on the first five series in \code{ca533}.
@@ -233,15 +233,15 @@
@
There is (at least) one other way of looking at the average interseries
-correlation of a dataset. The \code{interseries.cor} function in dplR
+correlation of a data set. The \code{interseries.cor} function in dplR
gives a measure of average interseries correlation that is different than
the rbar measurements from \code{rwi.stats}. In this function,
correlations are calculated serially between each tree-ring series and a
master chronology built from all the other series in the \code{rwl} object
(leave-one-out principle). The average of those correlations
is sometimes called the ``overall interseries correlation.'' This number is
-typically higher than \code{rbar.tot}. We are showing just the first five series and the
-mean for all series here:
+typically higher than \code{rbar.tot}. We are showing just the first five series
+and the mean for all series here:
<<>>=
ca533.rho <- interseries.cor(ca533.rwi, prewhiten=TRUE,
More information about the Dplr-commits
mailing list