[Analogue-commits] r215 - pkg/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 26 20:52:43 CET 2011


Author: gsimpson
Date: 2011-03-26 20:52:41 +0100 (Sat, 26 Mar 2011)
New Revision: 215

Modified:
   pkg/man/bayesF.Rd
   pkg/man/logitreg.Rd
   pkg/man/roc.Rd
Log:
Example tweaks knock 3+ seconds off package check timings

Modified: pkg/man/bayesF.Rd
===================================================================
--- pkg/man/bayesF.Rd	2011-03-26 19:20:32 UTC (rev 214)
+++ pkg/man/bayesF.Rd	2011-03-26 19:52:41 UTC (rev 215)
@@ -100,9 +100,30 @@
 \author{Gavin L. Simpson}
 \seealso{\code{\link{roc}} and \code{\link{plot.bayesF}}.}
 \examples{
-## continue the example from ?roc
-example(roc)
+## load the example data
+data(swapdiat, swappH, rlgh)
 
+## merge training and test set on columns
+dat <- join(swapdiat, rlgh, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+swapdiat <- dat[[1]] / 100
+rlgh <- dat[[2]] / 100
+
+## fit an analogue matching (AM) model using the squared chord distance
+## measure - need to keep the training set dissimilarities
+swap.ana <- analog(swapdiat, rlgh, method = "SQchord",
+                   keep.train = TRUE)
+
+## fit the ROC curve to the SWAP diatom data using the AM results
+## Generate a grouping for the SWAP lakes
+clust <- hclust(as.dist(swap.ana$train), method = "ward")
+grps <- cutree(clust, 12)
+
+## fit the ROC curve
+swap.roc <- roc(swap.ana, groups = grps)
+swap.roc
+
 ## calculate the Bayes factors of analogue and no-analogue
 ## (uses observed probabilities of analogue/no-analogue
 swap.bayes <- bayesF(swap.roc)

Modified: pkg/man/logitreg.Rd
===================================================================
--- pkg/man/logitreg.Rd	2011-03-26 19:20:32 UTC (rev 214)
+++ pkg/man/logitreg.Rd	2011-03-26 19:52:41 UTC (rev 215)
@@ -80,9 +80,26 @@
 }
 \seealso{\code{\link{roc}}, \code{\link{bayesF}}, \code{\link{glm}}. }
 \examples{
-## continue the example from ?roc
-example(roc)
+## load the example data
+data(swapdiat, swappH, rlgh)
 
+## merge training and test set on columns
+dat <- join(swapdiat, rlgh, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+swapdiat <- dat[[1]] / 100
+rlgh <- dat[[2]] / 100
+
+## fit an analogue matching (AM) model using the squared chord distance
+## measure - need to keep the training set dissimilarities
+swap.ana <- analog(swapdiat, rlgh, method = "SQchord",
+                   keep.train = TRUE)
+
+## fit the ROC curve to the SWAP diatom data using the AM results
+## Generate a grouping for the SWAP lakes
+clust <- hclust(as.dist(swap.ana$train), method = "ward")
+grps <- cutree(clust, 12)
+
 ## fit the logit models to the analog object
 swap.lrm <- logitreg(swap.ana, grps)
 swap.lrm

Modified: pkg/man/roc.Rd
===================================================================
--- pkg/man/roc.Rd	2011-03-26 19:20:32 UTC (rev 214)
+++ pkg/man/roc.Rd	2011-03-26 19:52:41 UTC (rev 215)
@@ -124,10 +124,17 @@
   methods for selecting critical values of analogue-ness for
   dissimilarity coefficients.}
 \examples{
-## continue the example from join()
-example(join)
+## load the example data
+data(swapdiat, swappH, rlgh)
 
-## fit a analogue matching (AM) model using the squared chord distance
+## merge training and test set on columns
+dat <- join(swapdiat, rlgh, verbose = TRUE)
+
+## extract the merged data sets and convert to proportions
+swapdiat <- dat[[1]] / 100
+rlgh <- dat[[2]] / 100
+
+## fit an analogue matching (AM) model using the squared chord distance
 ## measure - need to keep the training set dissimilarities
 swap.ana <- analog(swapdiat, rlgh, method = "SQchord",
                    keep.train = TRUE)



More information about the Analogue-commits mailing list