[Analogue-commits] r165 - in pkg: inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Apr 23 16:37:49 CEST 2010


Author: gsimpson
Date: 2010-04-23 16:37:48 +0200 (Fri, 23 Apr 2010)
New Revision: 165

Modified:
   pkg/inst/ChangeLog
   pkg/man/RMSEP.Rd
   pkg/man/analog.Rd
   pkg/man/bootstrap.Rd
   pkg/man/cma.Rd
   pkg/man/dissimilarities.Rd
   pkg/man/mat.Rd
   pkg/man/mcarlo.Rd
   pkg/man/minDC.Rd
   pkg/man/plot.dissimilarities.Rd
   pkg/man/plot.mat.Rd
   pkg/man/plot.mcarlo.Rd
   pkg/man/plot.minDC.Rd
   pkg/man/predict.mat.Rd
   pkg/man/predict.wa.Rd
   pkg/man/reconPlot.Rd
   pkg/man/screeplot.Rd
Log:
Large reductions in package check timings as now using Imbrie and Kipp for examples

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/inst/ChangeLog	2010-04-23 14:37:48 UTC (rev 165)
@@ -2,9 +2,22 @@
 
 Version 0.6-24
 
+	* residuals: Residuals were defined as \hat{x}_i - x_i to match
+	fitted vs. observed scatterplots. Definition of residuals in wa()
+	and related functions has been changed to the more common
+	definition of x_i - \hat{x}. Reported by Andreas Plank and Steve
+	Juggins.
+
+	* plot.wa: Following changed definition of residuals, plot.wa()
+	now plots observed values on the y-axis and fitted values on the
+	x-axis for 'which = 1'.
+
 	* summary.predict.mat: print method was incorrectly extracting
 	the model estimates for training set samples.
 
+	* Package: reduced package check time in examples, by using
+	the Imbrie & Kipp data.
+
 Version 0.6-23
 
 	* tran: 'rootroot' transformation was same as 'cuberoot' from

Modified: pkg/man/RMSEP.Rd
===================================================================
--- pkg/man/RMSEP.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/RMSEP.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -71,24 +71,33 @@
 \seealso{\code{\link{mat}}, \code{\link{bootstrap}}, \code{\link{wa}},
   \code{\link{bootstrap.wa}}.}
 \examples{
-## continue the RLGH and SWAP example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
 ## fit the MAT model using the squared chord distance measure
-swap.mat <- mat(swapdiat, swappH, method = "SQchord")
+(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))
 
 ## Leave-one-out RMSEP for the MAT model
-RMSEP(swap.mat)
+RMSEP(ik.mat)
 
 ## bootstrap training set
-swap.boot <- bootstrap(swap.mat, n.boot = 100)
-swap.boot
+(ik.boot <- bootstrap(ik.mat, n.boot = 100))
 
 ## extract the Birks et al (1990) RMSEP
-RMSEP(swap.boot)
+RMSEP(ik.boot)
 
 ## Calculate the alternative formulation
-RMSEP(swap.boot, type = "standard")
+RMSEP(ik.boot, type = "standard")
 }
 \keyword{methods}
 \keyword{utilities}

Modified: pkg/man/analog.Rd
===================================================================
--- pkg/man/analog.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/analog.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -86,13 +86,25 @@
   modern training set.
 }
 \examples{
-## continue the example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
+## Imbrie and Kipp foraminfera sea-surface temperature
+
 ## analog matching between SWAP and RLGH core
-swap.analog <- analog(swapdiat, rlgh, method = "chord")
-swap.analog
-summary(swap.analog)
+ik.analog <- analog(ImbrieKipp, V12.122, method = "chord")
+ik.analog
+summary(ik.analog)
 
 }
 \keyword{multivariate}% at least one, from doc/KEYWORDS

Modified: pkg/man/bootstrap.Rd
===================================================================
--- pkg/man/bootstrap.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/bootstrap.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -129,11 +129,20 @@
 \seealso{\code{mat}, \code{plot.mat}, \code{summary.bootstrap.mat},
   \code{\link{residuals}}}
 \examples{
-## continue the ImbrieKipp example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
 ## Imbrie and Kipp foraminfera sea-surface temperature 
-
 ## fit the MAT model using the squared chord distance measure
 ik.mat <- mat(ImbrieKipp, SumSST, method = "SQchord")
 

Modified: pkg/man/cma.Rd
===================================================================
--- pkg/man/cma.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/cma.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -107,24 +107,29 @@
 \seealso{\code{\link{analog}}, \code{\link{stripchart}}, or
   \code{\link{boxplot}} for an alternative representation.}
 \examples{
-## continue the RLGH example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
-## select only the preindustrial reference condition samples
-## from the RLGH core
-rlgh.ref <- rlgh[25:37, ]
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
 
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
 ## analog matching between SWAP and RLGH reference samples
-swap.ana <- analog(swapdiat, rlgh.ref, method = "chord")
-swap.ana
+(ik.ana <- analog(ImbrieKipp, V12.122, method = "chord"))
 
-## close modern analogues
-swap.cma <- cma(swap.ana)
-swap.cma
-summary(swap.cma)
+## close modern analogues --- no analogues are "close"
+(ik.cma <- cma(ik.ana, cutoff = 0.91))
+summary(ik.cma)
 
 ## plot the results
-plot(swap.cma)
+plot(ik.cma)
+
 }
 \keyword{methods}
 \keyword{manip}

Modified: pkg/man/dissimilarities.Rd
===================================================================
--- pkg/man/dissimilarities.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/dissimilarities.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -34,18 +34,28 @@
 \author{Gavin L. Simpson}
 \seealso{\code{\link{analog}}, \code{\link{plot.dissimilarities}} }
 \examples{
-## continue the ImbrieKipp example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
-## analog matching between SWAP and RLGH core
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
+## analog matching between SWAPImbrie & Kipp and V12.122 core
 ik.analog <- analog(ImbrieKipp, V12.122, method = "chord")
 ik.analog
 summary(ik.analog)
 
 ## compare training set dissimilarities with normals
 ## and derive cut-offs
-ik.dissim <- dissim(ik.analog)
-plot(ik.dissim)
+ik.dij <- dissim(ik.analog)
+plot(ik.dij)
 
 }
 \keyword{methods}

Modified: pkg/man/mat.Rd
===================================================================
--- pkg/man/mat.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/mat.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -228,7 +228,7 @@
 ImbrieKippCore <- dat[[2]] / 100
 
 ## fit the MAT model using the squared chord distance measure
-ik.mat <- mat(ImbrieKipp, SumSST, method = "SQchord")
+ik.mat <- mat(ImbrieKipp, SumSST, method = "chord")
 ik.mat
 
 ## model summary

Modified: pkg/man/mcarlo.Rd
===================================================================
--- pkg/man/mcarlo.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/mcarlo.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -102,12 +102,22 @@
   distribution of simulated dissimilarities.
 }
 \examples{
-## continue from example(join)
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
 ## perform the modified method of Sawada (2004) - paired sampling,
 ## with replacement
-ik.mcarlo <- mcarlo(ImbrieKipp, method = "SQchord", nsamp = 1000,
+ik.mcarlo <- mcarlo(ImbrieKipp, method = "chord", nsamp = 1000,
                     type = "paired", replace = FALSE)
 ik.mcarlo
 

Modified: pkg/man/minDC.Rd
===================================================================
--- pkg/man/minDC.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/minDC.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -68,15 +68,25 @@
 \seealso{\code{\link{predict.mat}}, and \code{\link{plot.minDC}} for a
   plotting method.}
 \examples{
-## continue the ImbrieKipp example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
 ## fit the MAT model using the squared chord distance measure
 ik.mat <- mat(ImbrieKipp, SumSST, method = "SQchord")
 ik.mat
 
 ## reconstruct for the V12-122 core data
-v12.mat <- predict(ik.mat, V12.122, k = 10)
+v12.mat <- predict(ik.mat, V12.122)
 
 ## extract the minimum DC values
 v12.mdc <- minDC(v12.mat)

Modified: pkg/man/plot.dissimilarities.Rd
===================================================================
--- pkg/man/plot.dissimilarities.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/plot.dissimilarities.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -37,15 +37,27 @@
 \author{Gavin L. Simpson}
 \seealso{\code{\link{dissimilarities}}}
 \examples{
-## continue the RLGH example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
-## analog matching between SWAP and RLGH core
-swap.analog <- analog(swapdiat, rlgh, method = "chord")
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
 
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
+## analog matching between SWAPImbrie & Kipp and V12.122 core
+ik.analog <- analog(ImbrieKipp, V12.122, method = "chord")
+ik.analog
+summary(ik.analog)
+
 ## compare training set dissimilarities with normals
 ## and derive cut-offs
-swap.dissim <- dissim(swap.analog)
-plot(swap.dissim)
+ik.dij <- dissim(ik.analog)
+plot(ik.dij)
 }
 \keyword{hplot}% at least one, from doc/KEYWORDS

Modified: pkg/man/plot.mat.Rd
===================================================================
--- pkg/man/plot.mat.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/plot.mat.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -77,11 +77,21 @@
 \author{Gavin L. Simpson. Code borrows heavily from \code{\link{plot.lm}}.}
 \seealso{\code{\link{mat}}}
 \examples{
-## continue the ImbrieKipp example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
 ## MAT
-ik.mat <- mat(ImbrieKipp, SumSST, method = "SQchord")
+ik.mat <- mat(ImbrieKipp, SumSST, method = "chord")
 ik.mat
 summary(ik.mat)
 
@@ -91,5 +101,5 @@
 layout(1)
 
 }
-\keyword{hplot}% at least one, from doc/KEYWORDS
+\keyword{hplot}
 \keyword{methods}

Modified: pkg/man/plot.mcarlo.Rd
===================================================================
--- pkg/man/plot.mcarlo.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/plot.mcarlo.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -61,19 +61,29 @@
 \author{Gavin L. Simpson}
 \seealso{\code{\link{mcarlo}}}
 \examples{
-## continue the RLGH example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
 ## perform the modified method of Sawada (2004) - paired sampling,
 ## with replacement
-swap.mcarlo <- mcarlo(swapdiat, method = "SQchord", nsamp = 1000,
-                      type = "paired", replace = FALSE)
-swap.mcarlo
+ik.mcarlo <- mcarlo(ImbrieKipp, method = "chord", nsamp = 1000,
+                    type = "paired", replace = FALSE)
+ik.mcarlo
 
 ## plot the simulated distribution
-par(mfrow = c(2,1))
-plot(swap.mcarlo)
-par(mfrow = c(1,1))
+layout(matrix(1:2, ncol = 1))
+plot(ik.mcarlo)
+layout(1)
 }
 \keyword{hplot}% at least one, from doc/KEYWORDS
 \keyword{multivariate}% __ONLY ONE__ keyword per line

Modified: pkg/man/plot.minDC.Rd
===================================================================
--- pkg/man/plot.minDC.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/plot.minDC.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -67,24 +67,33 @@
 %}
 \seealso{\code{\link{minDC}}}
 \examples{
-## continue the RLGH example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
-## fit the MAT model using the squared chord distance measure
-swap.mat <- mat(swapdiat, swappH, method = "SQchord")
-swap.mat
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
 
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
+## fit the MAT model using the chord distance measure
+(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))
+
 ## reconstruct for the RLGH core data
-rlgh.mat <- predict(swap.mat, rlgh, k = 10)
+v12.mat <- predict(ik.mat, V12.122)
 
 ## extract the minimum DC values
-rlgh.mdc <- minDC(rlgh.mat)
-rlgh.mdc
+v12.mdc <- minDC(v12.mat)
+v12.mdc
 
 ## draw a plot of minimum DC by time
-plot(rlgh.mdc, use.labels = TRUE, xlab = "Depth (cm.)")
+plot(v12.mdc, use.labels = TRUE, xlab = "Depth (cm.)")
 }
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
-\keyword{hplot}% __ONLY ONE__ keyword per line
+\keyword{hplot}
 \keyword{methods}

Modified: pkg/man/predict.mat.Rd
===================================================================
--- pkg/man/predict.mat.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/predict.mat.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -145,14 +145,24 @@
 \author{Gavin L. Simpson}
 \seealso{\code{\link{mat}}, \code{\link{bootstrap.mat}}}
 \examples{
-## continue the RLGH and SWAP example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
-## fit the MAT model using the squared chord distance measure
-swap.mat <- mat(swapdiat, swappH, method = "SQchord")
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
 
-## predict for RLGH data
-predict(swap.mat, rlgh)
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
 
+## fit the MAT model using the chord distance measure
+(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))
+
+## predict for V12.122 data
+predict(ik.mat, V12.122)
+
 }
 \keyword{methods}% at least one, from doc/KEYWORDS

Modified: pkg/man/predict.wa.Rd
===================================================================
--- pkg/man/predict.wa.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/predict.wa.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -55,6 +55,28 @@
 \seealso{\code{\link{wa}}, \code{\link{predict.mat}},
     \code{\link{performance}}, \code{\link{reconPlot}}.}
 \examples{
+\dontrun{
+## Imbrie and Kipp
+data(ImbrieKipp)
+data(SumSST)
+ik.wa <- wa(SumSST ~ ., data = ImbrieKipp, tol.dw = TRUE,
+            min.tol = 2, small.tol = "min")
+ik.wa
+
+## load V12.122 core data
+data(V12.122)
+V12.122 <- V12.122 / 100
+
+## predict summer sea-surface temperature for V12.122 core
+v12.pred <- predict(ik.wa, V12.122, CV = "bootstrap", n.boot = 100)
+
+## draw the fitted reconstruction
+reconPlot(v12.pred, use.labels = TRUE, display = "bars")
+
+## extract the model performance stats
+performance(v12.pred)
+}
+
 ## continue the example from ?wa
 example(wa)
 

Modified: pkg/man/reconPlot.Rd
===================================================================
--- pkg/man/reconPlot.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/reconPlot.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -88,18 +88,27 @@
   transfer functions and \code{\link{wa}} and \code{\link{predict.wa}}
   for WA models.}
 \examples{
-## Continue example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
 ## Fit a MAT model
-swap.mat <- mat(swapdiat, swappH, method = "SQchord")
-swap.mat
+(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))
 
 ## Reconstruct pH for the RLGH core
-rlgh.pH <- predict(swap.mat, rlgh)
+v12.pH <- predict(ik.mat, V12.122)
 
 ## draw the reconstruction
-reconPlot(rlgh.pH, use.labels = TRUE, display.error = "bars",
-          xlab = "Depth", ylab = "pH")
+reconPlot(v12.pH, use.labels = TRUE, display.error = "bars",
+          xlab = "Depth", ylab = "Summer Seas-surface Temperature")
 }
 \keyword{hplot}

Modified: pkg/man/screeplot.Rd
===================================================================
--- pkg/man/screeplot.Rd	2010-04-19 17:49:45 UTC (rev 164)
+++ pkg/man/screeplot.Rd	2010-04-23 14:37:48 UTC (rev 165)
@@ -71,15 +71,23 @@
 }
 \seealso{\code{\link{screeplot}} }
 \examples{
-## continue the example from ?join
-example(join)
+## Imbrie and Kipp example
+## load the example data
+data(ImbrieKipp)
+data(SumSST)
+data(V12.122)
 
-## fit the MAT model using the squared chord distance measure
-swap.mat <- mat(swapdiat, swappH, method = "SQchord")
-swap.mat
+## merge training and test set on columns
+dat <- join(ImbrieKipp, V12.122, verbose = TRUE)
 
-##
-screeplot(swap.mat)
+## extract the merged data sets and convert to proportions
+ImbrieKipp <- dat[[1]] / 100
+V12.122 <- dat[[2]] / 100
+
+## fit the MAT model using the chord distance measure
+(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))
+
+screeplot(ik.mat)
 }
 \keyword{hplot}
 \keyword{methods}



More information about the Analogue-commits mailing list