From noreply at r-forge.r-project.org Thu Feb 2 03:18:16 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 2 Feb 2017 03:18:16 +0100 (CET) Subject: [Dplr-commits] r1045 - in pkg/dplR: . R Message-ID: <20170202021816.CFBE7188865@r-forge.r-project.org> Author: andybunn Date: 2017-02-02 03:18:15 +0100 (Thu, 02 Feb 2017) New Revision: 1045 Modified: pkg/dplR/ChangeLog pkg/dplR/R/detrend.R Log: dentrend bug fixed where make.plot wasn't being passed Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-01-18 15:07:52 UTC (rev 1044) +++ pkg/dplR/ChangeLog 2017-02-02 02:18:15 UTC (rev 1045) @@ -15,6 +15,8 @@ ----------------- - Added Friedman under method argument in the help file. It was ommitted by mistake. +- Bug in detrend fixed where make.plot was hard coded as FALSE which kept TRUE + from being passed to detrend.series. File: helpers.R ----------------- Modified: pkg/dplR/R/detrend.R =================================================================== --- pkg/dplR/R/detrend.R 2017-01-18 15:07:52 UTC (rev 1044) +++ pkg/dplR/R/detrend.R 2017-02-02 02:18:15 UTC (rev 1045) @@ -20,7 +20,7 @@ rn <- row.names(rwl) detrend.args <- c(alist(rwl.i), - list(make.plot = FALSE, method = method2, + list(make.plot = make.plot, method = method2, nyrs = nyrs, f = f, pos.slope = pos.slope, constrain.modnegexp = constrain2, verbose = FALSE, return.info = return.info, From noreply at r-forge.r-project.org Fri Feb 3 11:09:37 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 3 Feb 2017 11:09:37 +0100 (CET) Subject: [Dplr-commits] r1046 - pkg/dplR Message-ID: <20170203100937.4AC02188764@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-03 11:09:36 +0100 (Fri, 03 Feb 2017) New Revision: 1046 Modified: pkg/dplR/DESCRIPTION Log: Bring back the Date field to avoid warning with citation("dplR")... when using a development (non-CRAN) version of dplR or an old R. Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-02 02:18:15 UTC (rev 1045) +++ pkg/dplR/DESCRIPTION 2017-02-03 10:09:36 UTC (rev 1046) @@ -3,6 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.5 +Date: 2017-02-03 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", From noreply at r-forge.r-project.org Fri Feb 3 19:11:36 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 3 Feb 2017 19:11:36 +0100 (CET) Subject: [Dplr-commits] r1047 - in tags: . dplR-1.6.5 Message-ID: <20170203181136.A64211883FB@r-forge.r-project.org> Author: andybunn Date: 2017-02-03 19:11:36 +0100 (Fri, 03 Feb 2017) New Revision: 1047 Added: tags/dplR-1.6.5/ Log: Tagging release 1.6.5 Property changes on: tags/dplR-1.6.5 ___________________________________________________________________ Added: svn:ignore + dplR-Ex.R svn*.tmp .* *~ .Rproj.user *.Rproj revdep Added: svn:auto-props + *.c = svn:eol-style=LF *.h = svn:eol-style=LF Makefile = svn:eol-style=LF *.po = svn:eol-style=native *.pot = svn:eol-style=native *.R = svn:eol-style=native *.Rd = svn:eol-style=native *.Rnw = svn:eol-style=native *.sty = svn:eol-style=native Added: svn:mergeinfo + /branches/dplR-R-2.15:466-506 /branches/redfit:662-700 From noreply at r-forge.r-project.org Fri Feb 3 19:13:12 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 3 Feb 2017 19:13:12 +0100 (CET) Subject: [Dplr-commits] r1048 - pkg/dplR Message-ID: <20170203181312.4E717187947@r-forge.r-project.org> Author: andybunn Date: 2017-02-03 19:13:12 +0100 (Fri, 03 Feb 2017) New Revision: 1048 Modified: pkg/dplR/DESCRIPTION Log: New version number post CRAN release. Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-03 18:11:36 UTC (rev 1047) +++ pkg/dplR/DESCRIPTION 2017-02-03 18:13:12 UTC (rev 1048) @@ -2,7 +2,7 @@ Package: dplR Type: Package Title: Dendrochronology Program Library in R -Version: 1.6.5 +Version: 1.6.6 Date: 2017-02-03 Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph", "cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko", From noreply at r-forge.r-project.org Wed Feb 8 13:49:36 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 8 Feb 2017 13:49:36 +0100 (CET) Subject: [Dplr-commits] r1049 - in pkg/dplR: . tests/testthat Message-ID: <20170208124936.86A29187FDC@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-08 13:49:36 +0100 (Wed, 08 Feb 2017) New Revision: 1049 Modified: pkg/dplR/DESCRIPTION pkg/dplR/tests/testthat/test-chron.R pkg/dplR/tests/testthat/test-dplR.R Log: Replace calls to deprecated testthat functions, stay compatible with old R Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-03 18:13:12 UTC (rev 1048) +++ pkg/dplR/DESCRIPTION 2017-02-08 12:49:36 UTC (rev 1049) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-03 +Date: 2017-02-08 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/tests/testthat/test-chron.R =================================================================== --- pkg/dplR/tests/testthat/test-chron.R 2017-02-03 18:13:12 UTC (rev 1048) +++ pkg/dplR/tests/testthat/test-chron.R 2017-02-08 12:49:36 UTC (rev 1049) @@ -38,8 +38,8 @@ test_that("chron works (with autocorrelation)", { expect_equal(res2[["samp.depth"]], threes) expect_equal(res2[["xxxstd"]], srs2) - expect_more_than(length(which(is.na(res2[["xxxres"]]))), 0) - expect_less_than(sd2.2, sd2.1) + expect_true(length(which(is.na(res2[["xxxres"]]))) > 0) + expect_true(sd2.2 < sd2.1) }) } test.chron() Modified: pkg/dplR/tests/testthat/test-dplR.R =================================================================== --- pkg/dplR/tests/testthat/test-dplR.R 2017-02-03 18:13:12 UTC (rev 1048) +++ pkg/dplR/tests/testthat/test-dplR.R 2017-02-08 12:49:36 UTC (rev 1049) @@ -481,8 +481,8 @@ expect_equal(res.5, x) }) test_that("smoother spline means more error", { - expect_more_than(error.1, error.2) - expect_more_than(error.2, error.3) + expect_true(error.1 > error.2) + expect_true(error.2 > error.3) }) test_that("ffcsaps stops on bad parameters", { expect_error(ffcsaps(y, f=-1), "between 0 and 1") From noreply at r-forge.r-project.org Fri Feb 10 13:33:38 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 10 Feb 2017 13:33:38 +0100 (CET) Subject: [Dplr-commits] r1050 - in pkg/dplR: . man Message-ID: <20170210123338.9599818774C@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-10 13:33:38 +0100 (Fri, 10 Feb 2017) New Revision: 1050 Modified: pkg/dplR/DESCRIPTION pkg/dplR/man/detrend.series.Rd Log: Typographic apostrophe for consistency Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-08 12:49:36 UTC (rev 1049) +++ pkg/dplR/DESCRIPTION 2017-02-10 12:33:38 UTC (rev 1050) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-08 +Date: 2017-02-10 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.series.Rd =================================================================== --- pkg/dplR/man/detrend.series.Rd 2017-02-08 12:49:36 UTC (rev 1049) +++ pkg/dplR/man/detrend.series.Rd 2017-02-10 12:33:38 UTC (rev 1050) @@ -127,8 +127,8 @@ See the references below for further details on detrending. - The \code{"Friedman"} approach uses Friedman's \sQuote{super smoother} - as implemented in \code{\link{supsmu}}. The parameters + The \code{"Friedman"} approach uses Friedman\enc{?}{'}s \sQuote{super + smoother} as implemented in \code{\link{supsmu}}. The parameters \code{\var{wt}}, \code{\var{span}} and \code{\var{bass}} can be adjusted, but \code{\var{periodic}} is always set to \code{FALSE}. From noreply at r-forge.r-project.org Fri Feb 10 13:52:35 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 10 Feb 2017 13:52:35 +0100 (CET) Subject: [Dplr-commits] r1051 - in pkg/dplR: . R man Message-ID: <20170210125235.225A5187316@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-10 13:52:34 +0100 (Fri, 10 Feb 2017) New Revision: 1051 Added: pkg/dplR/R/sfrcs.R pkg/dplR/man/sfrcs.Rd Modified: pkg/dplR/ChangeLog pkg/dplR/NAMESPACE pkg/dplR/R/rcs.R pkg/dplR/man/rcs.Rd Log: Initial implementation of Signal-Free Regional Curve Standardization Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-10 12:33:38 UTC (rev 1050) +++ pkg/dplR/ChangeLog 2017-02-10 12:52:34 UTC (rev 1051) @@ -1,3 +1,16 @@ +* CHANGES IN dplR VERSION 1.6.6 + +File: sfrcs.R +---------------- + +- Added a detrending method, in function sfrcs(): Signal-Free + Regional Curve Standardization (Melvin and Briffa, 2014). + +File: rcs.R +---------------- + +- Technical changes to facilitate the implematation of sfrcs(). + * CHANGES IN dplR VERSION 1.6.5 File: combine.rwl.R Modified: pkg/dplR/NAMESPACE =================================================================== --- pkg/dplR/NAMESPACE 2017-02-10 12:33:38 UTC (rev 1050) +++ pkg/dplR/NAMESPACE 2017-02-10 12:52:34 UTC (rev 1051) @@ -52,9 +52,10 @@ series.rwl.plot, skel.plot, spag.plot, strip.rwl, tbrm, tridas.vocabulary, uuid.gen, wavelet.plot, wc.to.po, write.compact, write.crn, write.rwl, write.tridas, - write.tucson, plot.rwl, interseries.cor, summary.rwl, - plot.crn, insert.ring, delete.ring, xskel.ccf.plot, xskel.plot, - latexify, latexDate, rasterPlot, treeMean, rwl.report, print.rwl.report) + write.tucson, plot.rwl, interseries.cor, summary.rwl, plot.crn, + insert.ring, delete.ring, xskel.ccf.plot, xskel.plot, latexify, + latexDate, rasterPlot, treeMean, rwl.report, print.rwl.report, + sfrcs) S3method(print, redfit) S3method(plot, rwl) Modified: pkg/dplR/R/rcs.R =================================================================== --- pkg/dplR/R/rcs.R 2017-02-10 12:33:38 UTC (rev 1050) +++ pkg/dplR/R/rcs.R 2017-02-10 12:52:34 UTC (rev 1051) @@ -1,25 +1,27 @@ rcs <- function(rwl, po, nyrs=NULL, f=0.5, biweight=TRUE, ratios=TRUE, - rc.out=FALSE, make.plot=TRUE, ...) { - if (!is.data.frame(rwl)) { - stop("'rwl' must be a data.frame") - } - n.col <- ncol(rwl) - if (n.col == 0) { - return(rwl) - } - if (n.col != nrow(po)) { - stop("dimension problem: ", "'ncol(rw)' != 'nrow(po)'") - } + rc.out=FALSE, make.plot=TRUE, ..., rc.in=NULL, check=TRUE) { + n.col <- length(rwl) col.names <- names(rwl) - if (!all(sort(po[, 1]) == sort(col.names))) { - stop("series ids in 'po' and 'rwl' do not match") + if (isTRUE(check)) { + if (!is.data.frame(rwl)) { + stop("'rwl' must be a data.frame") + } + if (n.col == 0) { + return(rwl) + } + if (n.col != nrow(po)) { + stop("dimension problem: ", "'ncol(rw)' != 'nrow(po)'") + } + if (!all(sort(po[, 1]) == sort(col.names))) { + stop("series ids in 'po' and 'rwl' do not match") + } + if (any(po[, 2] < 1)) { + stop("minimum 'po' is 1") + } + if (!all(is.int(po[, 2]))) { + stop("each value in 'po' must be an integer") + } } - if (any(po[, 2] < 1)) { - stop("minimum 'po' is 1") - } - if (!all(is.int(po[, 2]))) { - stop("each value in 'po' must be an integer") - } seq.cols <- seq_len(n.col) rwl2 <- rwl rownames(rwl2) <- rownames(rwl2) # guard against NULL names funniness @@ -34,21 +36,27 @@ rwca[yrs2pith:(yrs2pith + nrow.m1), i] <- rwl.ord[, i] } - if (biweight) { - ca.m <- apply(rwca, 1, tbrm, C = 9) - } else { - ca.m <- rowMeans(rwca, na.rm=TRUE) + if (is.null(rc.in) || make.plot) { + if (biweight) { + ca.m <- apply(rwca, 1, tbrm, C = 9) + } else { + ca.m <- rowMeans(rwca, na.rm=TRUE) + } } - ## spline follows B&Q 2008 as 10% of the RC length - if (is.null(nyrs)) { - nyrs2 <- floor(length(na.omit(ca.m)) * 0.1) + if (is.null(rc.in)) { + ## spline follows B&Q 2008 as 10% of the RC length + if (is.null(nyrs)) { + nyrs2 <- floor(length(na.omit(ca.m)) * 0.1) + } else { + nyrs2 <- nyrs + } + tmp <- ffcsaps(y=na.omit(ca.m), nyrs=nyrs2, f=f) + rc <- rep(NA, nrow(rwca)) + rc[!is.na(ca.m)] <- tmp } else { - nyrs2 <- nyrs + rc <- rc.in } - tmp <- ffcsaps(y=na.omit(ca.m), nyrs=nyrs2, f=f) - rc <- rep(NA, nrow(rwca)) - rc[!is.na(ca.m)] <- tmp ## calculate indices as ratios or differences if (ratios) { rwica <- rwca/rc Added: pkg/dplR/R/sfrcs.R =================================================================== --- pkg/dplR/R/sfrcs.R (rev 0) +++ pkg/dplR/R/sfrcs.R 2017-02-10 12:52:34 UTC (rev 1051) @@ -0,0 +1,23 @@ +sfrcs <- function(rwl, po, nyrs=NULL, f=0.5, ratios=TRUE, + rc.out=FALSE, make.plot=TRUE, ...) { + n_col <- length(rwl) + rwl2 <- rwl + rcs_out <- rcs(rwl2, po = po, nyrs = nyrs, f = f, biweight = FALSE, + ratios = TRUE, rc.out = TRUE, make.plot = FALSE) + rc <- chron(rcs_out[["rwi"]], biweight = FALSE, prewhiten = FALSE)[[1L]] + while (any(rc <= 0.998, na.rm = TRUE) || + any(rc >= 1.002, na.rm = TRUE)) { + for (k in seq_len(n_col)) { + rwl2[[k]] <- rwl2[[k]] / rc + } + rcs_out <- rcs(rwl2, po = po, nyrs = nyrs, f = f, biweight = FALSE, + ratios = TRUE, rc.out = TRUE, make.plot = FALSE, + check = FALSE) + rc <- chron(rcs_out[["rwi"]], biweight=FALSE, prewhiten=FALSE)[[1L]] + } + ## 'nyrs' and 'f' are ignored when rc.in is used, and 'biweight' + ## only matters for plotting (when make.plot is TRUE) + rcs(rwl, po = po, nyrs = nyrs, f = f, biweight = FALSE, + ratios = ratios, rc.out = rc.out, make.plot = make.plot, + rc.in = rcs_out[["rc"]], check = FALSE, ...) +} Property changes on: pkg/dplR/R/sfrcs.R ___________________________________________________________________ Added: svn:eol-style + native Modified: pkg/dplR/man/rcs.Rd =================================================================== --- pkg/dplR/man/rcs.Rd 2017-02-10 12:33:38 UTC (rev 1050) +++ pkg/dplR/man/rcs.Rd 2017-02-10 12:52:34 UTC (rev 1051) @@ -8,7 +8,7 @@ } \usage{ rcs(rwl, po, nyrs = NULL, f = 0.5, biweight = TRUE, ratios = TRUE, - rc.out = FALSE, make.plot = TRUE, \dots) + rc.out = FALSE, make.plot = TRUE, \dots, rc.in = NULL, check = TRUE) } \arguments{ \item{rwl}{ a \code{data.frame} with series as columns and years as @@ -30,12 +30,15 @@ \item{ratios}{ \code{logical} flag. If \code{TRUE} (the default) then indices are calculated by division, if \code{FALSE} indices are calculated by subtraction. } + \item{rc.out}{ \code{logical} flag. Returns the regional curve along + with the ring-width indices if \code{TRUE}. } \item{make.plot}{ \code{logical} flag. Makes plots of the raw data and regional curve if \code{TRUE}. } - \item{rc.out}{ \code{logical} flag. Returns the regional curve along - with the ring-width indices if \code{TRUE}. } \item{\dots}{ other arguments passed to \code{\link[graphics]{plot}}. } + \item{rc.in}{ for internal use. } + \item{check}{ a \code{logical} flag. Bypass input checks by setting + this to \code{FALSE}. } } \details{ @@ -89,7 +92,7 @@ dplR by Andy Bunn. Patched and improved by Mikko Korpela. } \seealso{ \code{\link{detrend}}, \code{\link{chron}}, \code{\link{cms}}, - \code{\link{ffcsaps}} } + \code{\link{ffcsaps}}, \code{\link{sfrcs}} } \examples{library(utils) data(gp.rwl) data(gp.po) Added: pkg/dplR/man/sfrcs.Rd =================================================================== --- pkg/dplR/man/sfrcs.Rd (rev 0) +++ pkg/dplR/man/sfrcs.Rd 2017-02-10 12:52:34 UTC (rev 1051) @@ -0,0 +1,83 @@ +\encoding{UTF-8} +\name{sfrcs} +\alias{sfrcs} +\title{ Signal-Free Regional Curve Standardization } +\description{ + Detrend multiple ring-width series simultaneously using a signal-free + regional curve. +} +\usage{ +sfrcs(rwl, po, nyrs = NULL, f = 0.5, ratios = TRUE, + rc.out = FALSE, make.plot = TRUE, \dots) +} +\arguments{ + \item{rwl}{ a \code{data.frame} with series as columns and years as + rows such as that produced by \code{\link{read.rwl}} } + \item{po}{ a \code{data.frame} containing two variables. Variable one + (\code{\var{series}} in the example below) gives the series + \acronym{ID} as either \code{character}s or \code{factor}s. These + must exactly match \code{colnames(\var{rwl})}. Variable two + (\code{\var{pith.offset}} in the example below) must be integral + values and give the years from the beginning of the core to the pith + (or center) of the tree. The minimum value is 1. } + \item{nyrs}{ a number giving the rigidity of the smoothing spline, + defaults to 0.1 of length of the maximum cambial age (i.e., the + length of the regional curve) if \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. } + \item{ratios}{ \code{logical} flag. If \code{TRUE} (the default) then + indices are calculated by division, if \code{FALSE} indices are + calculated by subtraction. } + \item{rc.out}{ \code{logical} flag. Returns the regional curve along + with the ring-width indices if \code{TRUE}. } + \item{make.plot}{ \code{logical} flag. Makes plots of the raw data and + regional curve if \code{TRUE}. } + \item{\dots}{ other arguments passed to + \code{\link[graphics]{plot}}. } +} +\details{ + + This method detrends and standardizes tree-ring series by calculating + an age-related growth curve specific to the \code{\var{rwl}}. The + Signal-Free \acronym{RCS} iteratively calls \code{\link{rcs}} + according to \dQuote{Using the Signal-Free method with RCS} in Melvin + and Briffa (2014). + + The option \code{\var{ratios}} only affects the creation of the final + ring-width indices after the iterative detrending process (where + \code{\var{ratios}=TRUE}) has converged. The function computes ordinary + arithmetic means, i.e. passes \code{\var{biweight}=FALSE} to both + \code{\link{rcs}} and \code{\link{chron}}. + +} +\value{ + + A \code{data.frame} containing the dimensionless and detrended + ring-width indices with column names, row names and dimensions of + \code{\var{rwl}}. If \code{\var{rc.out}} is \code{TRUE} then a + \code{list} will be returned with a \code{data.frame} containing the + detrended ring widths as above and a \code{vector} containing the + regional curve. + +} +\references{ + Melvin, T. M. and Briffa, K. R. (2014) CRUST: Software for the + implementation of Regional Chronology Standardisation: Part + 1. Signal-Free RCS. \emph{Dendrochronologia}, \bold{32}(1), + 7\enc{?}{--}20. +} +\author{ + Mikko Korpela and Andy Bunn +} +\seealso{ \code{\link{detrend}}, \code{\link{chron}}, \code{\link{cms}}, + \code{\link{ffcsaps}}, \code{\link{rcs}} } +\examples{library(utils) +data(gp.rwl) +data(gp.po) +gp.rwi <- sfrcs(rwl = gp.rwl, po = gp.po, + rc.out = TRUE, make.plot = FALSE) +str(gp.rwi) +gp.rwi <- sfrcs(rwl = gp.rwl, po = gp.po, + make.plot = TRUE, main = "Regional Curve") +} +\keyword{ manip } Property changes on: pkg/dplR/man/sfrcs.Rd ___________________________________________________________________ Added: svn:eol-style + native From noreply at r-forge.r-project.org Wed Feb 15 14:27:01 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 15 Feb 2017 14:27:01 +0100 (CET) Subject: [Dplr-commits] r1052 - in pkg/dplR: . R src Message-ID: <20170215132701.DB2511881D6@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-15 14:27:01 +0100 (Wed, 15 Feb 2017) New Revision: 1052 Added: pkg/dplR/src/Makevars pkg/dplR/src/dplR-win.def pkg/dplR/src/init.c pkg/dplR/src/registered.h Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION pkg/dplR/NAMESPACE pkg/dplR/R/exactmean.R pkg/dplR/R/read.tucson.R pkg/dplR/src/exactmean.c pkg/dplR/src/gini.c pkg/dplR/src/rcompact.c pkg/dplR/src/readloop.c pkg/dplR/src/redfit.c pkg/dplR/src/sens.c pkg/dplR/src/tbrm.c Log: Registering native (C) routines and hiding entry points Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/ChangeLog 2017-02-15 13:27:01 UTC (rev 1052) @@ -1,5 +1,14 @@ * CHANGES IN dplR VERSION 1.6.6 +Files: NAMESPACE, src/..., R/... +---------------- + +- Technical change: Native routines are registered. + + +- Technical change: Visibility of native routines has been + limited, following 6.15 "Controlling visibility" in R-exts. + File: sfrcs.R ---------------- Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/DESCRIPTION 2017-02-15 13:27:01 UTC (rev 1052) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-10 +Date: 2017-02-15 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 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/NAMESPACE 2017-02-15 13:27:01 UTC (rev 1052) @@ -1,7 +1,4 @@ -useDynLib(dplR, dplR.gini=gini, dplR.makear1=makear1, - dplR.mean=exactmean, dplR.rcompact=rcompact, - dplR.seg50=seg50, dplR.sens1=sens1, dplR.sens2=sens2, - dplR.spectr=spectr, dplR.tbrm=tbrm, rwl.readloop=readloop) +useDynLib(dplR, .registration = TRUE, .fixes = "dplR.") import(graphics, stats) Modified: pkg/dplR/R/exactmean.R =================================================================== --- pkg/dplR/R/exactmean.R 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/R/exactmean.R 2017-02-15 13:27:01 UTC (rev 1052) @@ -1,5 +1,5 @@ `exactmean` <- function(x) { ## Drops NA and NaN values! - .Call(dplR.mean, as.double(x[!is.na(x)])) + .Call(dplR.exactmean, as.double(x[!is.na(x)])) } Modified: pkg/dplR/R/read.tucson.R =================================================================== --- pkg/dplR/R/read.tucson.R 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/R/read.tucson.R 2017-02-15 13:27:01 UTC (rev 1052) @@ -327,7 +327,7 @@ } extra.col <- dat[[13]] - res <- .Call(rwl.readloop, series.index, decade.yr, x) + res <- .Call(dplR.readloop, series.index, decade.yr, x) rw.mat <- res[[1]] min.year <- res[[2]] prec.rproc <- res[[3]] Added: pkg/dplR/src/Makevars =================================================================== --- pkg/dplR/src/Makevars (rev 0) +++ pkg/dplR/src/Makevars 2017-02-15 13:27:01 UTC (rev 1052) @@ -0,0 +1 @@ +PKG_CFLAGS = $(C_VISIBILITY) Added: pkg/dplR/src/dplR-win.def =================================================================== --- pkg/dplR/src/dplR-win.def (rev 0) +++ pkg/dplR/src/dplR-win.def 2017-02-15 13:27:01 UTC (rev 1052) @@ -0,0 +1,3 @@ +LIBRARY dplR.dll +EXPORTS + R_init_dplR Modified: pkg/dplR/src/exactmean.c =================================================================== --- pkg/dplR/src/exactmean.c 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/src/exactmean.c 2017-02-15 13:27:01 UTC (rev 1052) @@ -1,6 +1,7 @@ #include #include "dplR.h" #include "exactsum.h" +#include "registered.h" SEXP exactmean(SEXP x){ SEXP ans; Modified: pkg/dplR/src/gini.c =================================================================== --- pkg/dplR/src/gini.c 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/src/gini.c 2017-02-15 13:27:01 UTC (rev 1052) @@ -2,6 +2,7 @@ #include #include "dplR.h" #include "exactsum.h" +#include "registered.h" /* Written by Mikko Korpela */ SEXP gini(SEXP x){ Added: pkg/dplR/src/init.c =================================================================== --- pkg/dplR/src/init.c (rev 0) +++ pkg/dplR/src/init.c 2017-02-15 13:27:01 UTC (rev 1052) @@ -0,0 +1,27 @@ +#include +#include +#include + +#include "registered.h" + +#define CALLDEF(name, n) {#name, (DL_FUNC) &name, n} + +const static R_CallMethodDef R_CallDef[] = { + CALLDEF(exactmean, 1), + CALLDEF(gini, 1), + CALLDEF(makear1, 3), + CALLDEF(rcompact, 1), + CALLDEF(readloop, 3), + CALLDEF(seg50, 4), + CALLDEF(sens1, 1), + CALLDEF(sens2, 1), + CALLDEF(spectr, 14), + CALLDEF(tbrm, 2), + {NULL, NULL, 0} +}; + +void attribute_visible R_init_dplR(DllInfo *dll) { + R_registerRoutines(dll, NULL, R_CallDef, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); + R_forceSymbols(dll, TRUE); +} Property changes on: pkg/dplR/src/init.c ___________________________________________________________________ Added: svn:eol-style + LF Modified: pkg/dplR/src/rcompact.c =================================================================== --- pkg/dplR/src/rcompact.c 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/src/rcompact.c 2017-02-15 13:27:01 UTC (rev 1052) @@ -5,6 +5,7 @@ #include #include #include +#include "registered.h" #define CONTENT_LENGTH 80 #define LINE_LENGTH 83 /* 80 + 2 (newline characters) + 1 (null)*/ Modified: pkg/dplR/src/readloop.c =================================================================== --- pkg/dplR/src/readloop.c 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/src/readloop.c 2017-02-15 13:27:01 UTC (rev 1052) @@ -1,6 +1,7 @@ #include "dplR.h" #include #include +#include "registered.h" /* A function to speed up the heaviest part of read.tucson.R */ /* Written by Mikko Korpela */ Modified: pkg/dplR/src/redfit.c =================================================================== --- pkg/dplR/src/redfit.c 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/src/redfit.c 2017-02-15 13:27:01 UTC (rev 1052) @@ -22,18 +22,14 @@ #include #include #include +#include "registered.h" -SEXP seg50(SEXP k, SEXP nseg, SEXP segskip, SEXP np); void rmtrend(SEXP x, SEXP y, SEXP lengthfun, SEXP lmfit); -SEXP spectr(SEXP t, SEXP x, SEXP np, SEXP ww, SEXP tsin, SEXP tcos, SEXP wtau, - SEXP nseg, SEXP nfreq, SEXP avgdt, SEXP freq, SEXP n50, - SEXP segskip, SEXP lmfit); void ftfix(const double *xx, const double *tsamp, const size_t nxx, const double *freq, const size_t nfreq, const double si, const size_t lfreq, const double tzero, const double *tcos, - const double *tsin, const double *wtau, const dplr_ldouble sumbysqrt, - double *ftrx, double *ftix); -SEXP makear1(SEXP t, SEXP np, SEXP tau); + const double *tsin, const double *wtau, + const dplr_ldouble sumbysqrt, double *ftrx, double *ftix); /* dplR: Find the start of a segment. */ /* Formula from the original Fortran version: @@ -288,8 +284,8 @@ void ftfix(const double *xx, const double *tsamp, const size_t nxx, const double *freq, const size_t nfreq, const double si, const size_t lfreq, const double tzero, const double *tcos, - const double *tsin, const double *wtau, const dplr_ldouble sumbysqrt, - double *ftrx, double *ftix) { + const double *tsin, const double *wtau, + const dplr_ldouble sumbysqrt, double *ftrx, double *ftix) { const double_t tol1 = 1.0e-4; const double tol2 = 1.0e-8; const double_t const1 = M_SQRT1_2; Added: pkg/dplR/src/registered.h =================================================================== --- pkg/dplR/src/registered.h (rev 0) +++ pkg/dplR/src/registered.h 2017-02-15 13:27:01 UTC (rev 1052) @@ -0,0 +1,14 @@ +#include + +SEXP exactmean(SEXP x); +SEXP gini(SEXP x); +SEXP makear1(SEXP t, SEXP np, SEXP tau); +SEXP rcompact(SEXP filename); +SEXP readloop(SEXP series_index, SEXP decade, SEXP x); +SEXP seg50(SEXP k, SEXP nseg, SEXP segskip, SEXP np); +SEXP sens1(SEXP x); +SEXP sens2(SEXP x); +SEXP spectr(SEXP t, SEXP x, SEXP np, SEXP ww, SEXP tsin, SEXP tcos, SEXP wtau, + SEXP nseg, SEXP nfreq, SEXP avgdt, SEXP freq, SEXP n50, + SEXP segskip, SEXP lmfit); +SEXP tbrm(SEXP x, SEXP C); Property changes on: pkg/dplR/src/registered.h ___________________________________________________________________ Added: svn:eol-style + LF Modified: pkg/dplR/src/sens.c =================================================================== --- pkg/dplR/src/sens.c 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/src/sens.c 2017-02-15 13:27:01 UTC (rev 1052) @@ -1,6 +1,7 @@ #include #include "dplR.h" #include "exactsum.h" +#include "registered.h" /* Written by Mikko Korpela */ SEXP sens2(SEXP x){ Modified: pkg/dplR/src/tbrm.c =================================================================== --- pkg/dplR/src/tbrm.c 2017-02-10 12:52:34 UTC (rev 1051) +++ pkg/dplR/src/tbrm.c 2017-02-15 13:27:01 UTC (rev 1052) @@ -2,6 +2,7 @@ #include #include "dplR.h" #include "exactsum.h" +#include "registered.h" /* Tukey's Biweight Robust Mean (tbrm). There must be no NAs in 'x'. From noreply at r-forge.r-project.org Thu Feb 16 09:00:36 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Feb 2017 09:00:36 +0100 (CET) Subject: [Dplr-commits] r1053 - pkg/dplR Message-ID: <20170216080036.21C67188599@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-16 09:00:35 +0100 (Thu, 16 Feb 2017) New Revision: 1053 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION Log: Change version requirement for stringi Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-15 13:27:01 UTC (rev 1052) +++ pkg/dplR/ChangeLog 2017-02-16 08:00:35 UTC (rev 1053) @@ -1,5 +1,11 @@ * CHANGES IN dplR VERSION 1.6.6 +File: DESCRIPTION +---------------- + +- Version requirement for stringi bumped up to >= 0.2-3. Should have been + done for dplR 1.6.1 + Files: NAMESPACE, src/..., R/... ---------------- Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-15 13:27:01 UTC (rev 1052) +++ pkg/dplR/DESCRIPTION 2017-02-16 08:00:35 UTC (rev 1053) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-15 +Date: 2017-02-16 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", @@ -21,7 +21,7 @@ Imports: graphics, grDevices, grid, stats, utils, lattice (>= 0.13-6), Matrix (>= 1.0-3), digest (>= 0.2.3), gmp (>= 0.5-5), matrixStats (>= 0.50.0), png (>= 0.1-1), R.utils (>= 1.32.0), - stringi (>= 0.2-2), stringr (>= 0.4), XML (>= 2.1-0), + stringi (>= 0.2-3), stringr (>= 0.4), XML (>= 2.1-0), plyr (>= 1.8) Suggests: Biobase, Cairo (>= 1.5-0), dichromat (>= 1.2-3), foreach, forecast, iterators, knitr, RColorBrewer, testthat (>= 0.8), From noreply at r-forge.r-project.org Thu Feb 16 09:35:59 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Feb 2017 09:35:59 +0100 (CET) Subject: [Dplr-commits] r1054 - pkg/dplR/src Message-ID: <20170216083559.62D41183B48@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-16 09:35:59 +0100 (Thu, 16 Feb 2017) New Revision: 1054 Modified: pkg/dplR/src/init.c Log: The C function R_forceSymbols() is not available in R < 3.0.0 Modified: pkg/dplR/src/init.c =================================================================== --- pkg/dplR/src/init.c 2017-02-16 08:00:35 UTC (rev 1053) +++ pkg/dplR/src/init.c 2017-02-16 08:35:59 UTC (rev 1054) @@ -1,7 +1,9 @@ #include #include #include +#include +#include "dplR.h" #include "registered.h" #define CALLDEF(name, n) {#name, (DL_FUNC) &name, n} @@ -23,5 +25,7 @@ void attribute_visible R_init_dplR(DllInfo *dll) { R_registerRoutines(dll, NULL, R_CallDef, NULL, NULL); R_useDynamicSymbols(dll, FALSE); +#ifdef DPLR_RGEQ3 R_forceSymbols(dll, TRUE); +#endif } From noreply at r-forge.r-project.org Thu Feb 16 09:46:03 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Feb 2017 09:46:03 +0100 (CET) Subject: [Dplr-commits] r1055 - pkg/dplR/src Message-ID: <20170216084603.B26D11881D4@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-16 09:46:03 +0100 (Thu, 16 Feb 2017) New Revision: 1055 Modified: pkg/dplR/src/init.c Log: Rversion.h not needed here Modified: pkg/dplR/src/init.c =================================================================== --- pkg/dplR/src/init.c 2017-02-16 08:35:59 UTC (rev 1054) +++ pkg/dplR/src/init.c 2017-02-16 08:46:03 UTC (rev 1055) @@ -1,7 +1,6 @@ #include #include #include -#include #include "dplR.h" #include "registered.h" From noreply at r-forge.r-project.org Thu Feb 16 10:03:19 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Feb 2017 10:03:19 +0100 (CET) Subject: [Dplr-commits] r1056 - pkg/dplR/src Message-ID: <20170216090319.3A6E71882E0@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-16 10:03:18 +0100 (Thu, 16 Feb 2017) New Revision: 1056 Modified: pkg/dplR/src/init.c Log: const static => static const (avoid compiler warning) Modified: pkg/dplR/src/init.c =================================================================== --- pkg/dplR/src/init.c 2017-02-16 08:46:03 UTC (rev 1055) +++ pkg/dplR/src/init.c 2017-02-16 09:03:18 UTC (rev 1056) @@ -7,7 +7,7 @@ #define CALLDEF(name, n) {#name, (DL_FUNC) &name, n} -const static R_CallMethodDef R_CallDef[] = { +static const R_CallMethodDef R_CallDef[] = { CALLDEF(exactmean, 1), CALLDEF(gini, 1), CALLDEF(makear1, 3), From noreply at r-forge.r-project.org Thu Feb 16 11:58:02 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Feb 2017 11:58:02 +0100 (CET) Subject: [Dplr-commits] r1057 - pkg/dplR Message-ID: <20170216105802.67EBB188A8C@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-16 11:58:02 +0100 (Thu, 16 Feb 2017) New Revision: 1057 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION Log: Change version requirement for matrixStats Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-16 09:03:18 UTC (rev 1056) +++ pkg/dplR/ChangeLog 2017-02-16 10:58:02 UTC (rev 1057) @@ -6,6 +6,10 @@ - Version requirement for stringi bumped up to >= 0.2-3. Should have been done for dplR 1.6.1 +- Version requirement for matrixStats bumped up to >= 0.50.2 + because it's not possible to test 0.50.0, 0.50.1 with really old + versions of R, e.g. 2.15.2. + Files: NAMESPACE, src/..., R/... ---------------- Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-16 09:03:18 UTC (rev 1056) +++ pkg/dplR/DESCRIPTION 2017-02-16 10:58:02 UTC (rev 1057) @@ -7,8 +7,8 @@ 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", - role = c("aut", "cph")), person("Filipe", "Campelo", role = - c("aut", "cph")), person("Pierre", "M?rian", role = c("aut", + role = c("aut", "cph")), person("Filipe", "Campelo", role = + c("aut", "cph")), person("Pierre", "M?rian", role = c("aut", "cph")), person("Fares", "Qeadan", role = c("aut", "cph")), person("Christian", "Zang", role = c("aut", "cph")), person("Allan", "Buras", role = "ctb"), person("Jacob", @@ -20,8 +20,8 @@ Depends: R (>= 2.15.2) Imports: graphics, grDevices, grid, stats, utils, lattice (>= 0.13-6), Matrix (>= 1.0-3), digest (>= 0.2.3), gmp (>= 0.5-5), - matrixStats (>= 0.50.0), png (>= 0.1-1), R.utils (>= 1.32.0), - stringi (>= 0.2-3), stringr (>= 0.4), XML (>= 2.1-0), + matrixStats (>= 0.50.2), png (>= 0.1-1), R.utils (>= 1.32.0), + stringi (>= 0.2-3), stringr (>= 0.4), XML (>= 2.1-0), plyr (>= 1.8) Suggests: Biobase, Cairo (>= 1.5-0), dichromat (>= 1.2-3), foreach, forecast, iterators, knitr, RColorBrewer, testthat (>= 0.8), From noreply at r-forge.r-project.org Thu Feb 16 13:14:43 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Feb 2017 13:14:43 +0100 (CET) Subject: [Dplr-commits] r1058 - pkg/dplR Message-ID: <20170216121443.88AAC1881D4@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-16 13:14:43 +0100 (Thu, 16 Feb 2017) New Revision: 1058 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION Log: Change version requirement for png Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-16 10:58:02 UTC (rev 1057) +++ pkg/dplR/ChangeLog 2017-02-16 12:14:43 UTC (rev 1058) @@ -10,6 +10,9 @@ because it's not possible to test 0.50.0, 0.50.1 with really old versions of R, e.g. 2.15.2. +- Version requirement for png bumped up to >= 0.1-2: difficulties + compiling 0.1-1 on a test system (type voidp not defined). + Files: NAMESPACE, src/..., R/... ---------------- Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-16 10:58:02 UTC (rev 1057) +++ pkg/dplR/DESCRIPTION 2017-02-16 12:14:43 UTC (rev 1058) @@ -20,7 +20,7 @@ Depends: R (>= 2.15.2) Imports: graphics, grDevices, grid, stats, utils, lattice (>= 0.13-6), Matrix (>= 1.0-3), digest (>= 0.2.3), gmp (>= 0.5-5), - matrixStats (>= 0.50.2), png (>= 0.1-1), R.utils (>= 1.32.0), + matrixStats (>= 0.50.2), png (>= 0.1-2), R.utils (>= 1.32.0), stringi (>= 0.2-3), stringr (>= 0.4), XML (>= 2.1-0), plyr (>= 1.8) Suggests: Biobase, Cairo (>= 1.5-0), dichromat (>= 1.2-3), foreach, From noreply at r-forge.r-project.org Fri Feb 17 09:10:22 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 17 Feb 2017 09:10:22 +0100 (CET) Subject: [Dplr-commits] r1059 - in pkg/dplR: . R Message-ID: <20170217081022.6CDDB187996@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-17 09:10:22 +0100 (Fri, 17 Feb 2017) New Revision: 1059 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION pkg/dplR/R/rasterPlot.R Log: Version check for Cairo package in rasterPlot() Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-16 12:14:43 UTC (rev 1058) +++ pkg/dplR/ChangeLog 2017-02-17 08:10:22 UTC (rev 1059) @@ -1,5 +1,11 @@ * CHANGES IN dplR VERSION 1.6.6 +File: R/rasterPlot.R +---------------- + +- In rasterPlot(Cairo = TRUE, ...), added a version check for the Cairo + package + File: DESCRIPTION ---------------- Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-16 12:14:43 UTC (rev 1058) +++ pkg/dplR/DESCRIPTION 2017-02-17 08:10:22 UTC (rev 1059) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-16 +Date: 2017-02-17 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/R/rasterPlot.R =================================================================== --- pkg/dplR/R/rasterPlot.R 2017-02-16 12:14:43 UTC (rev 1058) +++ pkg/dplR/R/rasterPlot.R 2017-02-17 08:10:22 UTC (rev 1059) @@ -16,7 +16,8 @@ fallback <- TRUE for (k in 1:2) { if (Cairo2) { - if (requireNamespace("Cairo", quietly = TRUE)) { + if (requireNamespace("Cairo", quietly = TRUE) && + packageVersion("Cairo") >= "1.4-8") { caps <- Cairo::Cairo.capabilities() if (isTRUE(as.vector(caps["raster"]))) { fallback <- FALSE @@ -33,7 +34,7 @@ break } } else { - message("Cairo device unavailable") + message("Cairo device (>= 1.4-8) unavailable") } Cairo2 <- FALSE } else { From noreply at r-forge.r-project.org Mon Feb 20 12:35:55 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 20 Feb 2017 12:35:55 +0100 (CET) Subject: [Dplr-commits] r1060 - in pkg/dplR: . tests Message-ID: <20170220113555.D99BA1880CC@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-20 12:35:55 +0100 (Mon, 20 Feb 2017) New Revision: 1060 Modified: pkg/dplR/DESCRIPTION pkg/dplR/tests/testthat.R Log: Make "testthat" tests conditional on availability of the package Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-17 08:10:22 UTC (rev 1059) +++ pkg/dplR/DESCRIPTION 2017-02-20 11:35:55 UTC (rev 1060) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-17 +Date: 2017-02-20 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/tests/testthat.R =================================================================== --- pkg/dplR/tests/testthat.R 2017-02-17 08:10:22 UTC (rev 1059) +++ pkg/dplR/tests/testthat.R 2017-02-20 11:35:55 UTC (rev 1060) @@ -1,2 +1,3 @@ -library(testthat) -test_check("dplR") +if (require("testthat", character.only = TRUE)) { + test_check("dplR") +} From noreply at r-forge.r-project.org Wed Feb 22 14:19:58 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 22 Feb 2017 14:19:58 +0100 (CET) Subject: [Dplr-commits] r1061 - in pkg/dplR: . R Message-ID: <20170222131958.E066D18761B@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-22 14:19:58 +0100 (Wed, 22 Feb 2017) New Revision: 1061 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION pkg/dplR/R/latexify.R Log: Fix to unlikely case of running latexify() in C locale Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-20 11:35:55 UTC (rev 1060) +++ pkg/dplR/ChangeLog 2017-02-22 13:19:58 UTC (rev 1061) @@ -1,8 +1,14 @@ * CHANGES IN dplR VERSION 1.6.6 -File: R/rasterPlot.R +File: latexify.R ---------------- +- Fixed conversion bugs in the latexify() utility when working in + the C locale. + +File: rasterPlot.R +---------------- + - In rasterPlot(Cairo = TRUE, ...), added a version check for the Cairo package Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-20 11:35:55 UTC (rev 1060) +++ pkg/dplR/DESCRIPTION 2017-02-22 13:19:58 UTC (rev 1061) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-20 +Date: 2017-02-22 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/R/latexify.R =================================================================== --- pkg/dplR/R/latexify.R 2017-02-20 11:35:55 UTC (rev 1060) +++ pkg/dplR/R/latexify.R 2017-02-22 13:19:58 UTC (rev 1061) @@ -25,6 +25,11 @@ if (any(encBytes)) { y[encBytes] <- captureOutput(cat(y[encBytes], sep = "\n")) } + ## Convert strings to UTF-8 encoding, NFD (decomposed) form, for + ## processing of accented characters. Doing this early to + ## circumvent pecularities in gsub() (and nchar()) when working in + ## the C locale. + y <- stri_trans_nfd(y) Letters <- paste0(c(LETTERS, letters), collapse="") fontenc <- "fontenc" %in% packages textcomp <- "textcomp" %in% packages @@ -326,9 +331,6 @@ list(c(paste0(tmp, "(?=$|[[:digit:],.?!;:\\\\}+*/-])"), "\\1"), c(paste0(tmp, "(?! )"), "\\1 "))) - ## Convert strings to UTF-8 encoding, NFD (decomposed) form, for - ## processing of accented characters. - y <- stri_trans_nfd(y) ## Apply the substitutions in the list for (subst in substitutions) { y <- gsub(subst[1], subst[2], y, perl = TRUE) From noreply at r-forge.r-project.org Tue Feb 28 11:17:38 2017 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 28 Feb 2017 11:17:38 +0100 (CET) Subject: [Dplr-commits] r1062 - in pkg/dplR: . R Message-ID: <20170228101738.22F8E1862A8@r-forge.r-project.org> Author: mvkorpel Date: 2017-02-28 11:17:37 +0100 (Tue, 28 Feb 2017) New Revision: 1062 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION pkg/dplR/R/helpers.R Log: Another update for the rare C locale Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2017-02-22 13:19:58 UTC (rev 1061) +++ pkg/dplR/ChangeLog 2017-02-28 10:17:37 UTC (rev 1062) @@ -1,5 +1,11 @@ * CHANGES IN dplR VERSION 1.6.6 +File: helpers.R +---------------- + +- Internal helper fix.names() is more robust when working in the C + locale. + File: latexify.R ---------------- Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2017-02-22 13:19:58 UTC (rev 1061) +++ pkg/dplR/DESCRIPTION 2017-02-28 10:17:37 UTC (rev 1062) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.6 -Date: 2017-02-22 +Date: 2017-02-28 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/R/helpers.R =================================================================== --- pkg/dplR/R/helpers.R 2017-02-22 13:19:58 UTC (rev 1061) +++ pkg/dplR/R/helpers.R 2017-02-28 10:17:37 UTC (rev 1062) @@ -204,7 +204,8 @@ } rename.flag[idx.bad] <- TRUE ## Remove inappropriate characters (replace with nothing) - x.cut[idx.bad] <- gsub(bad.chars, "", x.cut[idx.bad]) + x.cut[idx.bad] <- gsub(bad.chars, "", x.cut[idx.bad], + useBytes = !l10n_info()[["MBCS"]]) } } if (!is.null(limit)) {