[Dplr-commits] r966 - in pkg/dplR: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 4 15:05:19 CET 2015


Author: mvkorpel
Date: 2015-03-04 15:05:18 +0100 (Wed, 04 Mar 2015)
New Revision: 966

Modified:
   pkg/dplR/ChangeLog
   pkg/dplR/DESCRIPTION
   pkg/dplR/NAMESPACE
   pkg/dplR/R/write.tridas.R
Log:
Cleaner retrieval of dplR version number in write.tridas()

Modified: pkg/dplR/ChangeLog
===================================================================
--- pkg/dplR/ChangeLog	2015-02-18 21:08:20 UTC (rev 965)
+++ pkg/dplR/ChangeLog	2015-03-04 14:05:18 UTC (rev 966)
@@ -32,6 +32,7 @@
 - Importing captureOutput() from R.utils.
 - Importing package Matrix.
 - Importing various functions from matrixStats.
+- Importing packageDescription() from utils, dropped installed.packages().
 - Exporting net().
 
 Various .R files
@@ -82,6 +83,12 @@
   value of the argument.  Reported by Daniel Bishop and Neil
   Pederson.
 
+File: write.tridas.R
+--------------------
+
+- Implementation detail: When checking the package version,
+  packageDescription() is now used instead of installed.packages().
+
 * CHANGES IN dplR VERSION 1.6.2
 
 No functional changes.  A unit test was changed so it would not fail

Modified: pkg/dplR/DESCRIPTION
===================================================================
--- pkg/dplR/DESCRIPTION	2015-02-18 21:08:20 UTC (rev 965)
+++ pkg/dplR/DESCRIPTION	2015-03-04 14:05:18 UTC (rev 966)
@@ -3,7 +3,7 @@
 Type: Package
 Title: Dendrochronology Program Library in R
 Version: 1.6.3
-Date: 2015-02-12
+Date: 2015-03-04
 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/NAMESPACE
===================================================================
--- pkg/dplR/NAMESPACE	2015-02-18 21:08:20 UTC (rev 965)
+++ pkg/dplR/NAMESPACE	2015-03-04 14:05:18 UTC (rev 966)
@@ -31,7 +31,7 @@
 
 importFrom(stringr, str_pad, str_trim)
 
-importFrom(utils, head, installed.packages, read.fwf, tail,
+importFrom(utils, head, packageDescription, read.fwf, tail,
            packageVersion, write.table)
 
 import(Matrix)

Modified: pkg/dplR/R/write.tridas.R
===================================================================
--- pkg/dplR/R/write.tridas.R	2015-02-18 21:08:20 UTC (rev 965)
+++ pkg/dplR/R/write.tridas.R	2015-03-04 14:05:18 UTC (rev 966)
@@ -371,16 +371,9 @@
 
     ## TODO: Enable identifiers given by the user
     if (random.identifiers) {
-        prefix.stub <- "dplR"
-        ip <- try(installed.packages(), silent = TRUE)
-        if (!inherits(ip, "try-error")) {
-            dplR.index <- which(rownames(ip) == "dplR")
-            if (length(dplR.index) > 0) {
-                prefix.stub <-
-                    paste0(prefix.stub, ip[dplR.index[1], "Version"])
-            }
-        }
-        ugen <- uuid.gen(paste0(prefix.stub, fname))
+        ugen <- uuid.gen(paste0("dplR",
+                                packageDescription("dplR", fields = "Version"),
+                                fname))
     }
 
     ## <tridas>



More information about the Dplr-commits mailing list