[Dplr-commits] r835 - in pkg/dplR: . man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Apr 24 09:25:44 CEST 2014


Author: mvkorpel
Date: 2014-04-24 09:25:43 +0200 (Thu, 24 Apr 2014)
New Revision: 835

Modified:
   pkg/dplR/DESCRIPTION
   pkg/dplR/man/detrend.Rd
   pkg/dplR/man/fill.internal.NA.Rd
   pkg/dplR/man/print.redfit.Rd
   pkg/dplR/man/skel.plot.Rd
   pkg/dplR/man/write.compact.Rd
   pkg/dplR/man/write.crn.Rd
   pkg/dplR/man/write.rwl.Rd
   pkg/dplR/man/write.tridas.Rd
   pkg/dplR/man/write.tucson.Rd
Log:
In all examples that create files (even if in \dontrun):
* Use a tempfile()
* Print the filename
* Finally remove the file (command separated by an empty line)


Modified: pkg/dplR/DESCRIPTION
===================================================================
--- pkg/dplR/DESCRIPTION	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/DESCRIPTION	2014-04-24 07:25:43 UTC (rev 835)
@@ -3,7 +3,7 @@
 Type: Package
 Title: Dendrochronology Program Library in R
 Version: 1.6.0
-Date: 2014-04-23
+Date: 2014-04-24
 Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph",
         "cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko",
         "Korpela", role = c("aut", "trl")), person("Franco", "Biondi",

Modified: pkg/dplR/man/detrend.Rd
===================================================================
--- pkg/dplR/man/detrend.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/detrend.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -98,10 +98,14 @@
 ## Detrend using all methods. Returns a list
 ca533.rwi <- detrend(rwl = ca533)
 ## Save a pdf of all series
-pdf("foo.pdf")
+fname <- tempfile(fileext=".pdf")
+print(fname) # tempfile used for output
+pdf(fname)
 ca533.rwi <- detrend(rwl = ca533, method = c("Spline", "ModNegExp"),
                      make.plot = TRUE)
 dev.off()
+
+unlink(fname) # remove the file
 }
 }
 \keyword{ manip }

Modified: pkg/dplR/man/fill.internal.NA.Rd
===================================================================
--- pkg/dplR/man/fill.internal.NA.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/fill.internal.NA.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -34,7 +34,7 @@
   caution. For instance, some users code missing rings as \code{NA}
   instead of \code{0}. And missing values (i.e., \code{NA}) are
   sometimes present in maximum latewood density data when the rings are
-  small. A common, but not reccomended, practice is to leave stretches
+  small. A common, but not recommended, practice is to leave stretches
   of \code{NA} values in places where it has been impossible to
   accurately measure rings (perhaps because of a break in the core). It
   is often better to treat that core as two separate series (e.g., "01A"

Modified: pkg/dplR/man/print.redfit.Rd
===================================================================
--- pkg/dplR/man/print.redfit.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/print.redfit.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -75,9 +75,11 @@
 redf <- redfit(x[idx], t[idx], "time",
                nsim = 100, iwin = 0, ofac = 1, n50 = 1)
 print(redf)
-f <- tempfile(fileext=".csv")
-print(redf, csv.out = TRUE, file = f)
-redftable <- read.csv(f)
-unlink(f) # remove the file
+fname <- tempfile(fileext=".csv")
+print(fname) # tempfile used for output
+print(redf, csv.out = TRUE, file = fname)
+redftable <- read.csv(fname)
+
+unlink(fname) # remove the file
 }
 \keyword{ print }

Modified: pkg/dplR/man/skel.plot.Rd
===================================================================
--- pkg/dplR/man/skel.plot.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/skel.plot.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -88,8 +88,11 @@
 y <- co021[, 11]
 y.yrs <- as.numeric(rownames(co021))
 y.name <- colnames(co021)[11]
+
 ## send to postscript - 3 pages total
-postscript("xdating.examp.ps")
+fname1 <- tempfile(fileext=".ps")
+print(fname1) # tempfile used for PS output
+postscript(fname1)
 ## "Master series" with correct calendar dates
 skel.plot(x, yr.vec = x.yrs, sname = x.name, master = TRUE)
 ## Undated series, try to align with last plot
@@ -98,12 +101,18 @@
 skel.plot(y, yr.vec = y.yrs, sname = y.name)
 dev.off()
 
+unlink(fname1) # remove the PS file
+
 ## alternatively send to pdf
-pdf("xdating.examp.pdf", width = 10, height = 7.5, paper = "USr")
+fname2 <- tempfile(fileext=".pdf")
+print(fname2) # tempfile used for PDF output
+pdf(fname2, width = 10, height = 7.5, paper = "USr")
 skel.plot(x, yr.vec = x.yrs, sname = x.name, master = TRUE)
 skel.plot(y)
 skel.plot(y, yr.vec = y.yrs, sname = y.name)
 dev.off()
+
+unlink(fname2) # remove the PDF file
 }
 }
 \keyword{ hplot }

Modified: pkg/dplR/man/write.compact.Rd
===================================================================
--- pkg/dplR/man/write.compact.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/write.compact.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -57,6 +57,8 @@
 fname <- write.compact(rwl.df = co021,
                        fname = tempfile(fileext=".rwl"),
                        append = FALSE, prec = 0.001)
+print(fname) # tempfile used for output
+
 unlink(fname) # remove the file
 }
 \keyword{ IO }

Modified: pkg/dplR/man/write.crn.Rd
===================================================================
--- pkg/dplR/man/write.crn.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/write.crn.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -79,8 +79,10 @@
 ca533.rwi <- detrend(rwl = ca533, method = "ModNegExp")
 ca533.crn <- chron(ca533.rwi, prefix = "CAM")
 fname1 <- write.crn(ca533.crn, tempfile(fileext=".crn"))
+print(fname1) # tempfile used for output
+
 ## Put the standard and residual chronologies in a single file
-## with ITRDB header info on top. Not reccomended.
+## with ITRDB header info on top. Not recommended.
 ca533.crn <- chron(ca533.rwi, prefix = "CAM", prewhiten = TRUE)
 ca533.hdr <- list(site.id = "CAM", site.name = "Campito Mountain",
                   spp.code = "PILO", state.country = "California",
@@ -91,6 +93,8 @@
 fname2 <- write.crn(ca533.crn[, -2], tempfile(fileext=".crn"),
                     header = ca533.hdr)
 write.crn(ca533.crn[, -1], fname2, append = TRUE)
+print(fname2) # tempfile used for output
+
 unlink(c(fname1, fname2)) # remove the files
 }
 \keyword{ IO }

Modified: pkg/dplR/man/write.rwl.Rd
===================================================================
--- pkg/dplR/man/write.rwl.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/write.rwl.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -49,6 +49,8 @@
 fname <- write.rwl(rwl.df = co021, fname = tempfile(fileext=".rwl"),
                    format = "tucson", header = co021.hdr,
                    append = FALSE, prec = 0.001)
+print(fname) # tempfile used for output
+
 unlink(fname) # remove the file
 }
 \keyword{ IO }

Modified: pkg/dplR/man/write.tridas.Rd
===================================================================
--- pkg/dplR/man/write.tridas.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/write.tridas.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -359,6 +359,7 @@
     project.info = list(investigator = "E. Schulman",
                         title = "", category = "",
                         period = "", type = "unknown"))
+print(fname1) # tempfile used for output
 
 ## Write mean value chronology of detrended ring widths
 data(ca533)
@@ -371,6 +372,8 @@
         list(investigator = "Donald A. Graybill, V.C. LaMarche, Jr.",
              title = "Campito Mountain", category = "",
              period = "", type = "unknown"))
+print(fname2) # tempfile used for output
+
 unlink(c(fname1, fname2)) # remove the files
 }
 \keyword{ IO }

Modified: pkg/dplR/man/write.tucson.Rd
===================================================================
--- pkg/dplR/man/write.tucson.Rd	2014-04-23 13:32:39 UTC (rev 834)
+++ pkg/dplR/man/write.tucson.Rd	2014-04-24 07:25:43 UTC (rev 835)
@@ -109,6 +109,8 @@
                   lead.invs = "E. SCHULMAN", comp.date = "")
 fname <- write.tucson(rwl.df = co021, fname = tempfile(fileext=".rwl"),
                       header = co021.hdr, append = FALSE, prec = 0.001)
+print(fname) # tempfile used for output
+
 unlink(fname) # remove the file
 }
 \keyword{ IO }



More information about the Dplr-commits mailing list