From 83765f3e5f7bf212ec57b091451194c5b6f295c6 Mon Sep 17 00:00:00 2001 From: Lincoln Mullen Date: Tue, 24 Feb 2015 18:12:44 -0500 Subject: [PATCH 01/44] Split on sentence and other boundaries --- R/modifiers.r | 3 +++ tests/testthat/test-split.r | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/R/modifiers.r b/R/modifiers.r index 3fffe9d2..e212e07f 100644 --- a/R/modifiers.r +++ b/R/modifiers.r @@ -109,6 +109,9 @@ regex <- function(pattern, ignore_case = FALSE, multiline = FALSE, boundary <- function(type = c("character", "line_break", "sentence", "word"), skip_word_none = TRUE, ...) { type <- match.arg(type) + + if (type != "word" & missingArg(skip_word_none)) skip_word_none <- FALSE + options <- stri_opts_brkiter( type = type, skip_word_none = skip_word_none, diff --git a/tests/testthat/test-split.r b/tests/testthat/test-split.r index 942bf9e0..09f5f017 100644 --- a/tests/testthat/test-split.r +++ b/tests/testthat/test-split.r @@ -67,3 +67,16 @@ test_that("n sets exact number of splits in str_split_fixed", { equals(c("Subject", "Roger: his drinking problems"))) }) + +test_that("str_split can split sentences correctly", { + test <- "This is a sentence. Is this a sentence? Why, yes it is." + + expect_that( + length(str_split(test, boundary("sentence"))[[1]]), + equals(3)) + expect_that( + str_split(test, boundary("sentence")), + equals(list(c("This is a sentence. ", "Is this a sentence? ", + "Why, yes it is.")))) + +}) From ca8d2d5ed3c6f258639b274642a8fd614b74ebcb Mon Sep 17 00:00:00 2001 From: Joe Cheng Date: Mon, 30 Mar 2015 16:09:33 -0700 Subject: [PATCH 02/44] Use full arg name for rep(length.out=...) This bug causes warnings if options(warnPartialMatchArgs=TRUE). --- R/word.r | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/word.r b/R/word.r index e883ef11..3ffcbfa6 100644 --- a/R/word.r +++ b/R/word.r @@ -28,9 +28,9 @@ #' word(str, 2, sep = fixed('..')) word <- function(string, start = 1L, end = start, sep = fixed(" ")) { n <- max(length(string), length(start), length(end)) - string <- rep(string, length = n) - start <- rep(start, length = n) - end <- rep(end, length = n) + string <- rep(string, length.out = n) + start <- rep(start, length.out = n) + end <- rep(end, length.out = n) breaks <- str_locate_all(string, sep) words <- lapply(breaks, invert_match) From 4150a4d2614944b300a53b03fc4b9cedf3af1ea6 Mon Sep 17 00:00:00 2001 From: hadley Date: Tue, 14 Apr 2015 13:04:15 -0500 Subject: [PATCH 03/44] Update revdep checks --- cran-comments.md | 6 +- revdep/summary.md | 1230 +++++++++++++++++++++++---------------------- 2 files changed, 632 insertions(+), 604 deletions(-) diff --git a/cran-comments.md b/cran-comments.md index 6f8cd57d..a9b17688 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -10,8 +10,8 @@ There were no ERRORs, WARNINGs or NOTEs. This release changes the backend of stringr from R's built in regular expression engine to use instead use ICU's, as provided by the stringi package. The potential for backward incompatible changes was high so I have -R CMD check on all 144 downstream dependencies +R CMD check on all 155 downstream dependencies (https://github.com/hadley/stringr/blob/master/revdep/summary.md). As well as carefully reviewing the results, I notified all downstream maintainers -of the pending change on Dec 5, giving them a month to check their package -and make changes. +of the pending change in early Dec, giving them a lot of time to check their +packages and make changes. diff --git a/revdep/summary.md b/revdep/summary.md index 87d0aac2..13cb177a 100644 --- a/revdep/summary.md +++ b/revdep/summary.md @@ -4,9 +4,9 @@ |setting |value | |:--------|:----------------------------| -|version |R version 3.1.2 (2014-10-31) | +|version |R version 3.1.3 (2015-03-09) | |system |x86_64, darwin13.4.0 | -|ui |RStudio (0.99.104) | +|ui |RStudio (0.99.380) | |language |(EN) | |collate |en_US.UTF-8 | |tz |America/Chicago | @@ -15,14 +15,14 @@ |package |* |version |date |source | |:--------|:--|:-------|:----------|:--------------| -|knitr |* |1.8 |2014-11-11 |CRAN (R 3.1.2) | +|knitr |* |1.9 |2015-01-20 |CRAN (R 3.1.2) | |magrittr |* |1.5 |2014-11-22 |CRAN (R 3.1.2) | |stringi |* |0.4-1 |2014-12-14 |CRAN (R 3.1.2) | -|stringr |* |0.6.2 |2012-12-06 |CRAN (R 3.1.0) | -|testthat |* |0.9.1 |2014-10-01 |CRAN (R 3.1.1) | +|stringr |* |0.6.2 |2012-12-06 |CRAN (R 3.1.2) | +|testthat | |0.9.1 |2014-10-01 |CRAN (R 3.1.2) | # Check results -145 checked out of 145 dependencies +155 checked out of 155 dependencies ## acs (1.2) Maintainer: Ezra Haber Glenn @@ -52,73 +52,21 @@ Maintainer: Imanuel Costigan __OK__ -## afex (0.12-135) +## afex (0.13-145) Maintainer: Henrik Singmann -``` -checking examples ... ERROR -Running examples in ‘afex-Ex.R’ failed -The error most likely occurred in: - -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: aov.car -> ### Title: Convenience wrappers for car::Anova using either a formula or -> ### factor based interface. -> ### Aliases: aov.car aov4 ez.glm univ -> -> ### ** Examples -> -> -> # Examples from a pureyl within-design from -> # Maxwell & Delaney (2004, Chapter 11), -> # Table 12.5 (p. 578): -> data(md_12.1) -> ez.glm("id", "rt", md_12.1, within = c("angle", "noise"), -+ args.return=list(correction = "none", es = "none")) - Effect df MSE F p -1 angle 2, 18 3560.00 40.72 *** <.0001 -2 noise 1, 9 8460.00 33.77 *** .0003 -3 angle:noise 2, 18 1160.00 45.31 *** <.0001 -> -> # Default output -> ez.glm("id", "rt", md_12.1, within = c("angle", "noise")) - Effect df MSE F ges p -1 angle 1.92, 17.31 3702.02 40.72 *** .39 <.0001 -2 noise 1, 9 8460.00 33.77 *** .39 .0003 -3 angle:noise 1.81, 16.27 1283.22 45.31 *** .19 <.0001 -> -> -> # examples using obk.long (see ?obk.long), a long version of the OBrienKaiser dataset from car. -> -> data(obk.long, package = "afex") -> -> # run univariate mixed ANOVA for the full design: -> aov.car(value ~ treatment * gender + Error(id/phase*hour), -+ data = obk.long, observed = "gender") -Contrasts set to contr.sum for the following variables: treatment, gender -Error in nice.anova(object = list(SSP = list(`(Intercept)` = 101389.655172414, : - Observed variable not in data: gender -Calls: aov.car -> do.call -> nice.anova -Execution halted -``` +__OK__ ## algstat (0.0.2) Maintainer: David Kahle -``` -checking whether package ‘algstat’ can be installed ... ERROR -Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/algstat.Rcheck/00install.out’ for details. -``` +__OK__ -## alm (0.3.1) +## alm (0.4.0) Maintainer: Scott Chamberlain Bug reports: http://www.github.com/ropensci/alm/issues -``` -checking package dependencies ... NOTE -Package which this enhances but not available for checking: ‘rCharts’ -``` +__OK__ ## AnDE (1.0) Maintainer: Sai Teja Ranuva @@ -134,8 +82,6 @@ Packages in Depends field not imported from: ‘discretization’ ‘foreign’ ‘functional’ ‘stringr’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. ``` ``` checking R code for possible problems ... NOTE @@ -144,12 +90,12 @@ mdl: no visible global function definition for ‘cutPoints’ setVar: no visible global function definition for ‘Compose’ ``` -## aqp (1.7-7) +## aqp (1.8) Maintainer: Dylan Beaudette ``` checking package dependencies ... NOTE -Package suggested but not available for checking: ‘soilDB’ +Packages suggested but not available for checking: ‘soilDB’ ‘compositions’ ``` ``` checking examples ... ERROR @@ -172,20 +118,22 @@ Calls: data -> find.package Execution halted ``` -## BatchJobs (1.5) +## BatchJobs (1.6) Maintainer: Bernd Bischl Bug reports: https://github.com/tudo-r/BatchJobs/issues __OK__ -## BayesFactor (0.9.9) +## BayesFactor (0.9.11-1) Maintainer: Richard D. Morey Bug reports: https://github.com/richarddmorey/BayesFactor/issues ``` -checking whether package ‘BayesFactor’ can be installed ... ERROR -Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/BayesFactor.Rcheck/00install.out’ for details. +checking package dependencies ... ERROR +Package required but not available: ‘RcppEigen’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` ## beepr (1.1) @@ -212,20 +160,43 @@ Maintainer: Steven Pollack __OK__ +## broom (0.3.6) +Maintainer: David Robinson +Bug reports: http://github.com/dgrtwo/broom/issues + +__OK__ + ## Causata (4.2-0) Maintainer: Justin Hemann ``` -checking package dependencies ... ERROR -Package required but not available: ‘RMySQL’ - -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +checking top-level files ... NOTE +Non-standard file/directory found at top level: + ‘integration_tests’ +``` +``` +checking R code for possible problems ... NOTE +GetMetadata.Connect: no visible global function definition for + ‘dbGetQuery’ +GetRawData.Connect: no visible global function definition for + ‘dbGetQuery’ +``` +``` +checking line endings in Makefiles ... NOTE +Found the following Makefile(s) without a final LF: + inst/doc/Makefile +Some ‘make’ programs ignore lines not ending in LF. +``` +``` +checking files in ‘vignettes’ ... NOTE +The following files look like leftovers/mistakes: + ‘Causata-vignette.log’ +Please remove them from your package. ``` -## choroplethr (2.1.1) +## choroplethr (3.0.0) Maintainer: Ari Lamstein -Bug reports: https://github.com/trulia/choroplethr/issues +Bug reports: https://github.com/arilamstein/choroplethr/issues __OK__ @@ -234,7 +205,7 @@ Maintainer: Emanuele Eccel __OK__ -## CLME (2.0-1) +## CLME (2.0-2) Maintainer: Casey M. Jelsema Bug reports: https://github.com/jelsema/CLME/issues @@ -246,7 +217,7 @@ Bug reports: https://github.com/cancercentrum/commentr/issues __OK__ -## COPASutils (0.1.5) +## COPASutils (0.1.6) Maintainer: Erik Andersen __OK__ @@ -260,8 +231,6 @@ Packages in Depends field not imported from: ‘XML’ ‘stringr’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. ``` ``` checking R code for possible problems ... NOTE @@ -323,17 +292,13 @@ Bug reports: https://github.com/yhat/db.r/issues ``` checking package dependencies ... NOTE -Packages suggested but not available for checking: ‘RPostgreSQL’ ‘RMySQL’ +Package suggested but not available for checking: ‘RPostgreSQL’ ``` ## decctools (0.2.0) Maintainer: James Keirstead -``` -checking whether package ‘decctools’ can be installed ... ERROR -Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/decctools.Rcheck/00install.out’ for details. -``` +__OK__ ## docopt (0.4.2) Maintainer: Edwin de Jonge @@ -343,7 +308,10 @@ __OK__ ## dplR (1.6.2) Maintainer: Andy Bunn -__OK__ +``` +checking package dependencies ... NOTE +Package suggested but not available for checking: ‘Biobase’ +``` ## EasyMARK (1.0) Maintainer: John Waller @@ -351,7 +319,7 @@ Maintainer: John Waller ``` checking whether package ‘EasyMARK’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/EasyMARK.Rcheck/00install.out’ for details. +See ‘/private/tmp/Rtmph7PUNf/check_cran8a7e788398cb/EasyMARK.Rcheck/00install.out’ for details. ``` ## eeptools (0.3.1) @@ -362,7 +330,7 @@ checking R code for possible problems ... NOTE moves_calc: no visible binding for global variable ‘id’ ``` -## enaR (2.8) +## enaR (2.8.1) Maintainer: Matthew K. Lau __OK__ @@ -375,8 +343,9 @@ checking R code for possible problems ... NOTE eqs2lavaan: no visible binding for global variable ‘r’ ``` -## evaluate (0.5.5) -Maintainer: Yihui Xie +## evaluate (0.6) +Maintainer: Yihui Xie +Bug reports: https://github.com/hadley/evaluate/issues __OK__ @@ -389,8 +358,6 @@ Packages in Depends field not imported from: ‘ape’ ‘geiger’ ‘seqinr’ ‘stringr’ ‘taxize’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. ``` ``` checking R code for possible problems ... NOTE @@ -421,6 +388,13 @@ __OK__ ## fbRanks (2.0) Maintainer: E Holmes +``` +checking dependencies in R code ... NOTE +'library' or 'require' calls in package code: + ‘RCurl’ ‘RJSONIO’ ‘XML’ ‘glmnet’ ‘httr’ ‘speedglm’ ‘tcltk’ ‘xtable’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` ``` checking R code for possible problems ... NOTE print.fbRanks: no visible global function definition for ‘xtable’ @@ -581,51 +555,20 @@ team.name.select: no visible global function definition for ‘tkwait.window’ ``` -## FRESA.CAD (1.0) +## fitbitScraper (0.1.2) +Maintainer: Cory Nissen + +__OK__ + +## FRESA.CAD (2.0.2) Maintainer: Jose Gerardo Tamez-Pena ``` -checking examples ... ERROR -Running examples in ‘FRESA.CAD-Ex.R’ failed -The error most likely occurred in: +checking package dependencies ... ERROR +Package required but not available: ‘RcppArmadillo’ -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: rankInverseNormalDataFrame -> ### Title: Performs a Z transformation of the data using the Rank Inverse -> ### Normal Transform -> ### Aliases: rankInverseNormalDataFrame -> ### Keywords: Data_Conditioning -> -> ### ** Examples -> -> ## Use the Prostate cancer data -> require(rpart) -Loading required package: rpart -> data(stagec) -> dataCancer <- stagec[complete.cases(stagec),] -> ## List the variables to rank inverse -> varlist <- data.frame(c("g2","grade"),c("cells in G2 phase","tumor grade")) -> ## Set the group of no progression -> noProgress <- subset(dataCancer,pgstat==0) -> ## Rank the variables -> CancerZTransform <- rankInverseNormalDataFrame(varlist,dataCancer,noProgress) - Variable: g2 Min: -13.74673 Max: 72.52673 - Variable: grade Min: -0.0820667 Max: 4.082067 -> ## show the heatmap -> x <- heatMaps (varlist,outcome='pgstat',dataframe=CancerZTransform,outcomeGain=4) -Loading required package: gplots - -Attaching package: ‘gplots’ - -The following object is masked from ‘package:stats’: - - lowess - -Loading required package: RColorBrewer -Error in stri_locate_first_regex(string, pattern, opts_regex = attr(pattern, : - Incorrectly nested parentheses in regexp pattern. (U_REGEX_MISMATCHED_PAREN) -Calls: heatMaps -> str_locate -> stri_locate_first_regex -> .Call -Execution halted +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` ## fslr (1.3) @@ -639,21 +582,36 @@ Maintainer: Nikolai Gorte ``` checking package dependencies ... ERROR -Packages required but not available: ‘osmar’ ‘frbs’ +Packages required but not available: ‘osmar’ ‘frbs’ ‘rgeos’ ‘rgdal’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` -## games (1.1-1) +## games (1.1.2) Maintainer: Brenton Kenkel __OK__ -## geotopbricks (1.3.5.4) +## genderizeR (1.0.0) +Maintainer: Kamil Wais +Bug reports: https://github.com/kalimu/genderizeR + +``` +checking Rd cross-references ... NOTE +Package unavailable to check Rd xrefs: ‘sortinghat’ +``` + +## geotopbricks (1.3.6) Maintainer: Emanuele Cordano -__OK__ +``` +checking package dependencies ... ERROR +Package required but not available: ‘rgdal’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +``` ## gfcanalysis (1.2) Maintainer: Alex Zvoleff @@ -661,100 +619,27 @@ Bug reports: https://github.com/azvoleff/gfcanalysis/issues ``` checking package dependencies ... ERROR -Package required but not available: ‘rasterVis’ +Packages required but not available: ‘rgdal’ ‘rgeos’ ‘rasterVis’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` ## GGally (0.5.0) Maintainer: Barret Schloerke -``` -checking dependencies in R code ... NOTE -No Java runtime present, requesting install. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. -``` +__OK__ -## ggmap (2.3) -Maintainer: David Kahle +## ggenealogy (0.1.0) +Maintainer: Lindsay Rutter -``` -checking DESCRIPTION meta-information ... NOTE -License components which are templates and need '+ file LICENSE': - MIT -``` -``` -checking dependencies in R code ... NOTE -Package in Depends field not imported from: ‘ggplot2’ - These packages need to be imported from (in the NAMESPACE file) - for when this namespace is loaded but not attached. -Unexported objects imported by ':::' calls: - ‘ggplot2:::Geom’ ‘ggplot2:::Position’ ‘ggplot2:::Stat’ - ‘ggplot2:::is.constant’ ‘ggplot2:::rename_aes’ - ‘plyr:::list_to_dataframe’ - See the note in ?`:::` about the use of this operator. -There are ::: calls to the package's namespace in its code. A package - almost never needs to use ::: for its own objects: - ‘annotation_raster’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. -``` -``` -checking R code for possible problems ... NOTE -ggimage: no visible global function definition for ‘ggplot’ -ggimage: no visible global function definition for ‘aes’ -ggimage: no visible global function definition for ‘geom_blank’ -ggimage: no visible global function definition for ‘scale_x_continuous’ -ggimage: no visible global function definition for ‘scale_y_continuous’ -gglocator: no visible global function definition for ‘last_plot’ -ggmap: no visible global function definition for ‘ggplot’ -ggmap: no visible global function definition for ‘aes’ -ggmap: no visible global function definition for ‘geom_blank’ -ggmap: no visible global function definition for ‘annotate’ -ggmap: no visible global function definition for ‘geom_tile’ -ggmap: no visible global function definition for ‘scale_fill_identity’ -ggmap: no visible global function definition for ‘xlim’ -ggmap: no visible global function definition for ‘ylim’ -ggmap: no visible global function definition for ‘coord_map’ -ggmap: no visible global function definition for ‘scale_x_continuous’ -ggmap: no visible global function definition for ‘scale_y_continuous’ -ggmap: no visible global function definition for ‘theme’ -ggmap: no visible global function definition for ‘element_rect’ -qmplot: no visible global function definition for ‘ggplot’ -qmplot: no visible global function definition for ‘annotate’ -qmplot: no visible global function definition for ‘coord_map’ -qmplot: no visible global function definition for ‘scale_x_continuous’ -qmplot: no visible global function definition for ‘scale_y_continuous’ -qmplot: no visible global function definition for ‘theme’ -qmplot: no visible global function definition for ‘element_rect’ -qmplot: no visible global function definition for ‘facet_null’ -qmplot: no visible global function definition for ‘facet_wrap’ -qmplot: no visible global function definition for ‘facet_grid’ -qmplot : : no visible global function definition for ‘layer’ -theme_inset: no visible global function definition for ‘theme_get’ -theme_inset: no visible global function definition for ‘element_blank’ -theme_nothing: no visible global function definition for ‘theme’ -theme_nothing: no visible global function definition for - ‘element_blank’ -``` -``` -checking Rd line widths ... NOTE -Rd file 'get_cloudmademap.Rd': - \usage lines wider than 90 characters: - get_cloudmademap(bbox = c(left = -95.80204, bottom = 29.38048, right = -94.92313, top = 30.14344), - -Rd file 'get_openstreetmap.Rd': - \usage lines wider than 90 characters: - get_openstreetmap(bbox = c(left = -95.80204, bottom = 29.38048, right = -94.92313, top = 30.14344), - -Rd file 'get_stamenmap.Rd': - \usage lines wider than 90 characters: - get_stamenmap(bbox = c(left = -95.80204, bottom = 29.38048, right = -94.92313, top = 30.14344), - -These lines will be truncated in the PDF manual. -``` +__OK__ + +## ggmap (2.4) +Maintainer: David Kahle +Bug reports: https://github.com/dkahle/ggmap/issues + +__OK__ ## ggsubplot (0.3.2) Maintainer: Garrett Grolemund @@ -765,49 +650,58 @@ __OK__ Maintainer: Keaven Anderson ``` -checking re-building of vignette outputs ... NOTE -Error in re-building vignettes: - ... -Loading required package: gsDesign -Loading required package: ggplot2 -Loading required package: xtable -Loading required package: stringr -Loading required package: RUnit -Loading required package: plyr -Quitting from lines 146-147 (gsSurvTemplate.rnw) -Error: processing vignette 'gsSurvTemplate.rnw' failed with diagnostics: -Missing closing bracket on a bracket expression. (U_REGEX_MISSING_CLOSE_BRACKET) -Execution halted - +checking line endings in Makefiles ... NOTE +Found the following Makefile(s) without a final LF: + inst/unitTests/Makefile +Some ‘make’ programs ignore lines not ending in LF. ``` -## GSIF (0.4-3) +## gsheet (0.1.0) +Maintainer: Max Conway +Bug reports: https://github.com/maxconway/gsheet/issues + +__OK__ + +## GSIF (0.4-4) Maintainer: Tomislav Hengl ``` checking package dependencies ... ERROR Packages required but not available: - ‘RSAGA’ ‘dismo’ ‘aqp’ ‘plotKML’ ‘gstat’ ‘quantregForest’ + ‘RSAGA’ ‘dismo’ ‘rgdal’ ‘aqp’ ‘plotKML’ Packages suggested but not available for checking: - ‘soiltexture’ ‘fossil’ ‘AICcmodavg’ ‘SDMTools’ ‘spacetime’ - ‘gdalUtils’ + ‘soiltexture’ ‘spatstat’ ‘quantregForest’ ‘fossil’ ‘gdalUtils’ + ‘maxlike’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` ## HistogramTools (0.3.1) Maintainer: Murray Stokely -__OK__ +``` +checking package dependencies ... NOTE +Package which this enhances but not available for checking: ‘RProtoBuf’ +``` +``` +checking dependencies in R code ... NOTE +'library' or 'require' call to ‘RProtoBuf’ in package code. + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` +``` +checking Rd cross-references ... NOTE +Package unavailable to check Rd xrefs: ‘RProtoBuf’ +``` ## hoardeR (0.0-2) Maintainer: Daniel Fischer __OK__ -## htmlTable (1.0) +## htmlTable (1.2) Maintainer: Max Gordon Bug reports: https://github.com/gforge/htmlTable/issues @@ -823,7 +717,8 @@ The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: htmlTable > ### Title: Outputting HTML tables -> ### Aliases: htmlTable htmlTable.default print.htmlTable +> ### Aliases: htmlTable htmlTable.default knit_print.htmlTable +> ### print.htmlTable > > ### ** Examples > @@ -834,24 +729,25 @@ The error most likely occurred in: + list("Column 1", "Column 2"))) > htmlTable(output) - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
Column 1Column 2
Row 113
Row 224
Column 1Column 2
Row 113
Row 224
> > # An advanced output > output <- @@ -899,8 +795,6 @@ Maintainer: Hadley Wickham checking dependencies in R code ... NOTE Namespace in Imports field not imported from: ‘R6’ All declared Imports should be used. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. ``` ## indicoio (0.3) @@ -908,11 +802,14 @@ Maintainer: Madison May __OK__ -## io (0.2.1) +## io (0.2.2) Maintainer: David J. H. Shih Bug reports: https://bitbucket.org/djhshih/io/issues -__OK__ +``` +checking package dependencies ... NOTE +Package suggested but not available for checking: ‘rhdf5’ +``` ## ISOweek (0.6-2) Maintainer: Uwe Block @@ -922,184 +819,25 @@ checking Rd cross-references ... NOTE Package unavailable to check Rd xrefs: ‘surveillance’ ``` -## knitr (1.8) +## knitr (1.9) Maintainer: Yihui Xie Bug reports: https://github.com/yihui/knitr/issues -``` -checking examples ... ERROR -Running examples in ‘knitr-Ex.R’ failed -The error most likely occurred in: - -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Sweave2knitr -> ### Title: Convert Sweave to knitr documents -> ### Aliases: Sweave2knitr -> -> ### ** Examples -> -> Sweave2knitr(text = "<>=") # this is valid -[1] "<>=" -> Sweave2knitr(text = "<>=") # dev='png' -capitalizing true/false to TRUE/FALSE: - * png=true -replacing pdf/jpeg/png/tikz=TRUE with dev='pdf'/'jpeg'/'png'/'tikz': - * png=TRUE -[1] "<>=" -> Sweave2knitr(text = "<>=") -removing pdf/jpeg/png/eps/tikz=FALSE: - * eps=TRUE, pdf=FALSE, results=tex, width=5, prefix.string=foo -replacing eps=TRUE with dev='postscript': - * eps=TRUE, , results=tex, width=5, prefix.string=foo -replacing results=tex with results=asis: - * dev='postscript', , results=tex, width=5, prefix.string=foo -quoting the results option: - * dev='postscript', , results=asis, width=5, prefix.string=foo -replacing width/height with fig.width/fig.height: - * dev='postscript', , results='asis', width=5, prefix.string=foo -replacing prefix.string=foo with fig.path='foo': - * dev='postscript', , results='asis', fig.width=5, - prefix.string=foo -[1] "<>=" -> Sweave2knitr(text = "<<,png=false,fig=TRUE>>=") -capitalizing true/false to TRUE/FALSE: - * ,png=false,fig=TRUE -removing the unnecessary option fig=TRUE: - * ,png=FALSE,fig=TRUE -removing pdf/jpeg/png/eps/tikz=FALSE: - * ,png=FALSE, -[1] "<<>>=" -> Sweave2knitr(text = "\\SweaveOpts{echo=false}") -capitalizing true/false to TRUE/FALSE: - * echo=false -changing \SweaveOpts{} to opts_chunk$set(): - * \SweaveOpts{echo=false} -[1] "\n<>=\nlibrary(knitr)\nopts_chunk$set(\necho=FALSE\n)\n@\n" -> Sweave2knitr(text = "\\SweaveInput{hello.Rnw}") -replacing \SweaveInput{...} with <>=: - * \SweaveInput{hello.Rnw} -[1] "\n<<'child-hello.Rnw', child='hello.Rnw'>>=\n@\n" -> # Sweave example in utils -> testfile = system.file("Sweave", "Sweave-test-1.Rnw", package = "utils") -> Sweave2knitr(testfile, output = "Sweave-test-knitr.Rnw") -capitalizing true/false to TRUE/FALSE: - * fig=true -removing the unnecessary option fig=TRUE: - * fig=TRUE - * fig=TRUE -quoting the results option: - * results=hide -removing options 'print', 'term', 'prefix': - * print=TRUE - * echo=TRUE,print=TRUE -capitalizing true/false to TRUE/FALSE: - * echo=true -changing \SweaveOpts{} to opts_chunk$set(): - * \SweaveOpts{echo=FALSE} - * \SweaveOpts{echo=true} -removing extra lines (#n shows line numbers): - * (#69) @ -> knit("Sweave-test-knitr.Rnw") # or knit2pdf() directly -Warning: closing unused connection 3 (/Library/Frameworks/R.framework/Resources/library/utils/Sweave/Sweave-test-1.Rnw) - - -processing file: Sweave-test-knitr.Rnw - - | - | | 0% - | - |.... | 6% - ordinary text without R code - - - | - |....... | 11% -label: unnamed-chunk-1 (with options) -List of 1 - $ include: logi FALSE - - - | - |........... | 17% - ordinary text without R code - - - | - |.............. | 22% -label: unnamed-chunk-2 - - | - |.................. | 28% -label: unnamed-chunk-3 (with options) -List of 1 - $ results: chr "hide" - - - | - |...................... | 33% - ordinary text without R code - - - | - |......................... | 39% -label: unnamed-chunk-4 (with options) -List of 1 - $ echo: logi TRUE - - - | - |............................. | 44% - ordinary text without R code - - - | - |................................ | 50% -label: unnamed-chunk-5 - - | - |.................................... | 56% - inline R code fragments - - - | - |........................................ | 61% -label: unnamed-chunk-6 (with options) -List of 1 - $ include: logi FALSE - - - | - |........................................... | 67% - ordinary text without R code - - - | - |............................................... | 72% -label: unnamed-chunk-7 - - | - |................................................... | 78% - ordinary text without R code - - - | - |...................................................... | 83% -label: unnamed-chunk-8 -Quitting from lines 68-70 (Sweave-test-knitr.Rnw) -Error in stri_split_regex(string, pattern, n = n, simplify = FALSE, opts_regex = attr(pattern, : - Missing closing bracket on a bracket expression. (U_REGEX_MISSING_CLOSE_BRACKET) -Calls: knit ... -> str_split -> stri_split_regex -> .Call - -Execution halted -``` +__OK__ ## KoNLP (0.76.9) Maintainer: Heewon Jeon ``` -checking whether package ‘KoNLP’ can be installed ... ERROR -Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/KoNLP.Rcheck/00install.out’ for details. +checking dependencies in R code ... NOTE +Package in Depends field not imported from: ‘Sejong’ + These packages need to be imported from (in the NAMESPACE file) + for when this namespace is loaded but not attached. +':::' call which should be '::': ‘rJava:::.jniInitialized’ + See the note in ?`:::` about the use of this operator. +There are ::: calls to the package's namespace in its code. A package + almost never needs to use ::: for its own objects: + ‘.KoNLPEnv’ ``` ## LindenmayeR (0.1-0) @@ -1111,8 +849,6 @@ checking dependencies in R code ... NOTE Package in Depends field not imported from: ‘grid’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. ``` ``` checking R code for possible problems ... NOTE @@ -1140,17 +876,13 @@ Bug reports: https://github.com/hadley/lubridate/issues ``` checking package dependencies ... NOTE -Package which this enhances but not available for checking: ‘fts’ +Packages which this enhances but not available for checking: ‘its’ ‘fts’ ``` -## mailR (0.3) +## mailR (0.4.1) Maintainer: Rahul Premraj -``` -checking whether package ‘mailR’ can be installed ... ERROR -Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/mailR.Rcheck/00install.out’ for details. -``` +__OK__ ## managelocalrepo (0.1.4) Maintainer: Imanuel Costigan @@ -1160,6 +892,13 @@ __OK__ ## MARSS (3.9) Maintainer: Elizabeth Holmes - NOAA Federal +``` +checking dependencies in R code ... NOTE +'library' or 'require' calls in package code: + ‘Hmisc’ ‘stringr’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` ``` checking R code for possible problems ... NOTE build.eqn.tex: no visible global function definition for ‘str_detect’ @@ -1185,18 +924,182 @@ toLatex.marssMODEL: no visible global function definition for ‘str_replace’ ``` +## MazamaSpatialUtils (0.2.3) +Maintainer: Jonathan Callahan + +``` +checking package dependencies ... ERROR +Packages required but not available: ‘rgdal’ ‘rgeos’ + +Package suggested but not available for checking: ‘ISOcodes’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +``` + ## mpoly (0.0.5) Maintainer: David Kahle ``` -checking whether package ‘mpoly’ can be installed ... ERROR -Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/mpoly.Rcheck/00install.out’ for details. +checking examples ... ERROR +Running examples in ‘mpoly-Ex.R’ failed +The error most likely occurred in: + +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") +> ### Name: mp +> ### Title: Define a multivariate polynomial. +> ### Aliases: mp +> +> ### ** Examples +> +> ( m <- mp('x + y + x y') ) +x + y + x y +> is.mpoly( m ) +[1] TRUE +> unclass(m) +[[1]] + x coef + 1 1 + +[[2]] + y coef + 1 1 + +[[3]] + x y coef + 1 1 1 + +> +> mp('x - y') +x - y +> mp('x - 1') +x - 1 +> mp('x + y') +x + y +> mp('x - 5') +x - 5 +> mp('x - -5') +x + 5 +> mp('10 x 6 x') # -> 60 x^2 +60 x^2 +> mp('10 x 6 x + 10 x 6 x y y 2') # -> 60 x^2 + 120 x^2 y^2 +60 x^2 + 120 x^2 y^2 +> +> mp('x^2 + x^2 y') # -> x^2 + x^2 y +x^2 + x^2 y +> +> mp('x - x') # -> 0 +0 +> mp('x - 4 x') # -> -3 x +-3 x +> mp('x y^2 - y^2 x') # -> 0 +0 +> +> mp('5^2') # -> 25 +25 +> mp('2^2 x + 5^2 + 3^2') # -> 4 x + 34 +4 x + 34 +> mp('1 1') # -> 1 +1 +> mp('-1 -1 -1') # -> 1 +-1 +> mp('1 3 5^2 + 2 3^4 x') # -> 75 + 162 x +75 + 162 x +> mp("x - 2 x -3") # 7 x +7 x +> +> ( ms <- mp(c('x + y', '2 x')) ) +x + y +2 x +> is.mpolyList(ms) +[1] TRUE +> +> mp('10 x + 2 y 3 + x^2 5 y') # -> 10 x + 6 y + 5 x^2 y +10 x + 6 y + 5 x^2 y +> mp('x + 2 y + x^2 y + x y z') # -> x + 2 y + x^2 y + x y z +x + 2 y + x^2 y + x y z +> mp('x + 2 y + x^2 y + x y z', varorder = c('y', 'z', 'x')) # -> x + 2 y + y + y z x +x + 2 y + y x^2 + y z x +> #mp('x + 2 y + x^2 y', varorder = c('q', 'p')) # -> error +> +> mp('p111 + p121 2 p112^2') +p111 + 2 p121 p112^2 +> unclass(mp('p111 + p121 2 p112^2')) +[[1]] +p111 coef + 1 1 + +[[2]] +p121 p112 coef + 1 2 2 + +> +> mp('0') +0 +> mp('2') +2 +> mp('-5') +-5 +> mp('-4 x') +-4 x +> mp('y + -1 x') +y - x +> mp('-1 + x') +-1 + x +> +> mp("(x)") +x +> mp("((((x))))") +x +> mp("(x + 0)") +x +> mp("(x + 1)") +x + 1 +> mp("(x - 1)") +x - 1 +> mp("(-1 x - 1)") +-1 x - 1 +> mp("2 (x + 1)") +2 x + 2 +> mp("-1 (x + 1)") +-1 x - 1 +> +> +> string <- "-2 x + -1 x (3 x - (7 - 2 x)) 7 (x + 1) -3" +> mp(string) +-149 x + 105 x^3 - 42 x^2 +> # note that in the above problem, the -3 on the end is +> # times negative 3, not minus 3; that would be "... - 3" +> +> mp("(x + 1) (x - 1)") +x^2 - 1 +> mp("(x + 1) (x + 2)") +x^2 + 3 x + 2 +> mp("(x + 1)^5") +x^5 + 5 x^4 + 10 x^3 + 10 x^2 + 5 x + 1 +> mp("x + 1")^5 +x^5 + 5 x^4 + 10 x^3 + 10 x^2 + 5 x + 1 +> mp("3 (x + 1) (x + 2)^2") +3 x^3 + 15 x^2 + 24 x + 12 +> +> mp("(x + y) (x - y)") +x^2 - y^2 +> mp("((x + y) (x - y))^2") +Error in while (str_detect(fLP, "--")) { : + missing value where TRUE/FALSE needed +Calls: mp ... lapply -> FUN -> Reduce -> lapply -> as.list -> bubble +Execution halted ``` ## mtk (1.0) Maintainer: Juhui WANG +``` +checking dependencies in R code ... NOTE +'library' or 'require' call to ‘MASS’ in package code. + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` ``` checking R code for possible problems ... NOTE plmm.mtk: no visible global function definition for ‘stepAIC’ @@ -1232,10 +1135,19 @@ Bug reports: http://github.com/renozao/NMF/issues ``` checking package dependencies ... NOTE -Packages suggested but not available for checking: ‘RcppOctave’ ‘doMPI’ +Packages suggested but not available for checking: + ‘RcppOctave’ ‘doMPI’ ‘Biobase’ +``` +``` +checking dependencies in R code ... NOTE +'library' or 'require' calls in package code: + ‘Biobase’ ‘bigmemory’ ‘devtools’ ‘knitr’ ‘synchronicity’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. ``` ``` checking R code for possible problems ... NOTE +.wrapResult: no visible global function definition for ‘exprs’ devnmf: no visible global function definition for ‘load_all’ nmfReport: no visible global function definition for ‘knit2html’ posICA: no visible binding for global variable ‘fastICA’ @@ -1247,7 +1159,14 @@ test.match_atrack : .check: no visible global function definition for ``` ``` checking Rd cross-references ... NOTE -Package unavailable to check Rd xrefs: ‘RcppOctave’ +Packages unavailable to check Rd xrefs: ‘Biobase’, ‘RcppOctave’ +``` +``` +checking data for non-ASCII characters ... NOTE + Error in .requirePackage(package) : + unable to find required package 'Biobase' + Calls: ... .extendsForS3 -> extends -> getClassDef -> .requirePackage + Execution halted ``` ``` checking examples ... ERROR @@ -1285,12 +1204,7 @@ Execution halted ## OpenRepGrid (0.1.9) Maintainer: Mark Heckmann -``` -checking dependencies in R code ... NOTE -No Java runtime present, requesting install. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. -``` +__OK__ ## optiRum (0.35) Maintainer: Stephanie Locke @@ -1318,24 +1232,70 @@ Maintainer: Yi Tang __OK__ -## P2C2M (0.5) +## P2C2M (0.6) Maintainer: Michael Gruenstaeudl ``` -checking package dependencies ... ERROR -Packages required but not available: ‘apTreeshape’ ‘rPython’ - +checking package dependencies ... NOTE Packages suggested but not available for checking: - ‘genealogicalSorting’ ‘phybase’ ‘Rmpi’ ‘xtermStyle’ + ‘genealogicalSorting’ ‘phybase’ ‘Rmpi’ +``` +``` +checking data for non-ASCII characters ... NOTE + Note: found 490 marked UTF-8 strings +``` + +## patchSynctex (0.1-0) +Maintainer: Emmanuel Charpentier + +__OK__ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +## pathological (0.0-3) +Maintainer: Richard Cotton + +``` +checking examples ... ERROR +Running examples in ‘pathological-Ex.R’ failed +The error most likely occurred in: + +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") +> ### Name: decompose_path +> ### Title: Split a path into its components +> ### Aliases: decompose_path get_extension recompose_path +> ### recompose_path.decomposed_path replace_extension strip_extension +> +> ### ** Examples +> +> x <- c( ++ "somedir/foo.tgz", # single extension ++ "another dir\\bar.tar.gz", # double extension ++ "baz", # no extension ++ "quux. quuux.tbz2", # single ext, dots in filename ++ R.home(), # a dir ++ "~", # another dir ++ "~/quuuux.tar.xz", # a file in a dir ++ "", # empty ++ ".", # current dir ++ "..", # parent dir ++ NA_character_ # missing ++ ) +> (decomposed <- decompose_path(x)) +Error in stri_match_first_regex(string, pattern, opts_regex = attr(pattern, : + Missing closing bracket on a bracket expression. (U_REGEX_MISSING_CLOSE_BRACKET) +Calls: decompose_path -> str_match -> stri_match_first_regex -> .Call +Execution halted ``` ## PepPrep (1.1.0) Maintainer: Rafael Dellen -__OK__ +``` +checking package dependencies ... ERROR +Package required but not available: ‘biomaRt’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +``` ## pkgmaker (0.22) Maintainer: Renaud Gaujoux @@ -1346,6 +1306,13 @@ checking package dependencies ... NOTE Package suggested but not available for checking: ‘ReportingTools’ ``` ``` +checking dependencies in R code ... NOTE +'library' or 'require' calls in package code: + ‘argparse’ ‘devtools’ ‘knitr’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` +``` checking R code for possible problems ... NOTE .existsTestLogger: no visible binding for global variable ‘.testLogger’ CLIArgumentParser: no visible global function definition for @@ -1377,24 +1344,37 @@ write_PACKAGES_index: no visible global function definition for ‘finish’ ``` -## plotKML (0.4-8) +## plotKML (0.5-0) Maintainer: Tomislav Hengl ``` checking package dependencies ... ERROR Packages required but not available: - ‘spacetime’ ‘dismo’ ‘aqp’ ‘colorRamps’ ‘gstat’ ‘RSAGA’ + ‘rgdal’ ‘dismo’ ‘aqp’ ‘colorRamps’ ‘RSAGA’ Packages suggested but not available for checking: - ‘adehabitat’ ‘fossil’ ‘spcosa’ ‘rgbif’ ‘GSIF’ ‘intervals’ ‘gdalUtils’ + ‘adehabitat’ ‘fossil’ ‘spcosa’ ‘spatstat’ ‘rgbif’ ‘GSIF’ ‘gdalUtils’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` +## plotROC (1.3.3) +Maintainer: Michael C Sachs +Bug reports: http://github.com/sachsmc/plotROC/issues + +__OK__ + ## polywog (0.4-0) Maintainer: Brenton Kenkel +``` +checking dependencies in R code ... NOTE +'library' or 'require' calls in package code: + ‘lattice’ ‘rgl’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` ``` checking R code for possible problems ... NOTE plot.preplot.polywog: no visible global function definition for @@ -1410,6 +1390,12 @@ __OK__ Maintainer: Hadley Wickham Bug reports: https://github.com/hadley/profr/issues +``` +checking dependencies in R code ... NOTE +'library' or 'require' call to ‘ggplot2’ in package code. + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` ``` checking R code for possible problems ... NOTE ggplot.profr: no visible global function definition for ‘ggplot’ @@ -1428,14 +1414,7 @@ Bug reports: https://github.com/johnmyleswhite/ProjectTemplate/issues ``` checking package dependencies ... NOTE -Packages suggested but not available for checking: - ‘RMySQL’ ‘RODBC’ ‘RPostgreSQL’ -``` -``` -checking dependencies in R code ... NOTE -No Java runtime present, requesting install. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +Packages suggested but not available for checking: ‘RODBC’ ‘RPostgreSQL’ ``` ## pryr (0.1) @@ -1461,25 +1440,21 @@ read.px: no visible global function definition for ‘str_sub’ read.px: no visible global function definition for ‘str_length’ ``` -## pxweb (0.5.3) +## pxweb (0.5.5) Maintainer: Mans Magnusson Bug reports: https://github.com/rOpenGov/pxweb/issues __OK__ +## QCAtools (0.1) +Maintainer: Jirka Lewandowski + +__OK__ + ## quipu (1.9.0) Maintainer: Reinhard Simon -``` -checking re-building of vignette outputs ... NOTE -Error in re-building vignettes: - ... -Quitting from lines 95-96 (Quipu_tutorial.Rnw) -Error: processing vignette 'Quipu_tutorial.Rnw' failed with diagnostics: -Missing closing bracket on a bracket expression. (U_REGEX_MISSING_CLOSE_BRACKET) -Execution halted - -``` +__OK__ ## rattle (3.4.1) Maintainer: Graham Williams @@ -1487,8 +1462,8 @@ Maintainer: Graham Williams ``` checking package dependencies ... NOTE Packages suggested but not available for checking: - ‘RGtk2’ ‘cairoDevice’ ‘gWidgetsRGtk2’ ‘playwith’ ‘rggobi’ - ‘RGtk2Extras’ ‘RODBC’ ‘pkgDepTools’ + ‘RGtk2’ ‘cairoDevice’ ‘graph’ ‘gWidgetsRGtk2’ ‘playwith’ ‘RBGL’ + ‘rggobi’ ‘RGtk2Extras’ ‘RODBC’ ‘pkgDepTools’ ‘Rgraphviz’ ``` ``` checking installed package size ... NOTE @@ -1499,6 +1474,17 @@ checking installed package size ... NOTE po 1.2Mb ``` ``` +checking dependencies in R code ... NOTE +'library' or 'require' calls in package code: + ‘Hmisc’ ‘RBGL’ ‘RGtk2’ ‘RGtk2Extras’ ‘ROCR’ ‘RODBC’ ‘Rgraphviz’ ‘XML’ + ‘ada’ ‘arules’ ‘bitops’ ‘cairoDevice’ ‘colorspace’ ‘e1071’ ‘fBasics’ + ‘foreign’ ‘fpc’ ‘graph’ ‘grid’ ‘kernlab’ ‘methods’ ‘nnet’ + ‘pkgDepTools’ ‘pmml’ ‘randomForest’ ‘reshape’ ‘rggobi’ ‘rpart’ + ‘stats’ ‘survival’ ‘utils’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` +``` checking R code for possible problems ... NOTE Found an obsolete/platform-specific call in the following functions: ‘openMyDevice’ ‘printPlot’ ‘savePlotToFile’ @@ -1512,17 +1498,23 @@ event one is needed. Maintainer: Sara Varela Bug reports: https://github.com/ropensci/rAvis/issues -__OK__ +``` +checking package dependencies ... ERROR +Package required but not available: ‘rgdal’ -## RbioRXN (1.3.1) +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +``` + +## RbioRXN (1.5) Maintainer: Byoungnam Min ``` checking package dependencies ... ERROR -Package required but not available: ‘fmcsR’ +Packages required but not available: ‘fmcsR’ ‘ChemmineR’ ‘KEGGREST’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` ## rClinicalCodes (1.0.1) @@ -1537,7 +1529,7 @@ Bug reports: http://github.com/renozao/RcppOctave/issues ``` checking whether package ‘RcppOctave’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/RcppOctave.Rcheck/00install.out’ for details. +See ‘/private/tmp/Rtmph7PUNf/check_cran8a7e788398cb/RcppOctave.Rcheck/00install.out’ for details. ``` ## rdryad (0.1.1) @@ -1546,8 +1538,9 @@ Bug reports: https://github.com/ropensci/rdryad/issues __OK__ -## redcapAPI (1.1) -Maintainer: Benjamin Nutter +## redcapAPI (1.3) +Maintainer: Stephen Lane +Bug reports: https://github.com/nutterb/redcapAPI/issues __OK__ @@ -1559,10 +1552,16 @@ checking package dependencies ... NOTE Package suggested but not available for checking: ‘RODBC’ ``` ``` +checking dependencies in R code ... NOTE +'library' or 'require' calls in package code: + ‘RODBC’ ‘testthat’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` +``` checking tests ... ERROR Running the tests in ‘tests/test-all.R’ failed. Last 13 lines of output: - character() else names(CURLcodeValues)[i] } typeName = gsub("^CURLE_", "", typeName) @@ -1571,21 +1570,22 @@ Last 13 lines of output: else warning) fun(structure(list(message = msg, call = sys.call()), class = c(typeName, "GenericCurlError", "error", "condition"))) - }(35L, "Unknown SSL protocol error in connection to bbmc.ouhsc.edu:-9800", TRUE) + }(35L, "SSL peer handshake failed, the server most likely requires a client certificate to connect", + TRUE) Error: Test failures Execution halted ``` -## RefManageR (0.8.40) +## RefManageR (0.8.45) Maintainer: Mathew W. McLean ``` checking foreign function calls ... NOTE Foreign function call to a different package: .External("do_read_bib", ..., PACKAGE = "bibtex") -See the chapter ‘System and foreign language interfaces’ of the -‘Writing R Extensions’ manual. +See chapter ‘System and foreign language interfaces’ in the ‘Writing R +Extensions’ manual. ``` ## reportRx (1.0) @@ -1605,10 +1605,21 @@ Bug reports: https://github.com/andrie/rfordummies/issues __OK__ -## rgbif (0.7.7) +## rgbif (0.8.0) Maintainer: Scott Chamberlain Bug reports: https://github.com/ropensci/rgbif/issues +``` +checking package dependencies ... ERROR +Package required but not available: ‘rgeos’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +``` + +## RGENERATEPREC (1.0) +Maintainer: Emanuele Cordano + __OK__ ## rio (0.1.2) @@ -1651,6 +1662,12 @@ Execution halted Maintainer: Renaud Gaujoux Bug reports: http://github.com/renozao/rngtools/issues +``` +checking dependencies in R code ... NOTE +'library' or 'require' call to ‘parallel’ in package code. + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` ``` checking R code for possible problems ... NOTE RNGseq : : no visible global function definition for @@ -1664,9 +1681,15 @@ checkRNG: no visible global function definition for ‘checkTrue’ Maintainer: Scott Chamberlain Bug reports: http://www.github.com/ropensci/rnoaa/issues -__OK__ +``` +checking package dependencies ... ERROR +Packages required but not available: ‘rgdal’ ‘rgeos’ -## rNOMADS (2.1.1) +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +``` + +## rNOMADS (2.1.3) Maintainer: Daniel C. Bowman __OK__ @@ -1674,19 +1697,19 @@ __OK__ ## rnrfa (0.1.5) Maintainer: Claudia Vitolo -__OK__ +``` +checking package dependencies ... ERROR +Package required but not available: ‘rgdal’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +``` ## roxygen2 (4.1.0) Maintainer: Hadley Wickham __OK__ -## rplos (0.4.1) -Maintainer: Scott Chamberlain -Bug reports: http://www.github.com/ropensci/rplos/issues - -__OK__ - ## rprintf (0.1-2) Maintainer: Kun Ren Bug reports: https://github.com/renkun-ken/rprintf/issues @@ -1699,8 +1722,7 @@ Maintainer: Chuang Ma ``` checking package dependencies ... ERROR Packages required but not available: - ‘biwt’ ‘cairoDevice’ ‘gWidgets’ ‘gWidgetsRGtk2’ ‘minerva’ ‘parmigene’ - ‘snowfall’ + ‘biwt’ ‘cairoDevice’ ‘gWidgetsRGtk2’ ‘minerva’ ‘parmigene’ Package suggested but not available for checking: ‘ctc’ @@ -1710,17 +1732,34 @@ Depends: includes the non-default packages: Adding so many packages to the search path is excessive and importing selectively is preferable. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` -## RSiteCatalyst (1.4.2) +## RSiteCatalyst (1.4.3) Maintainer: Randy Zwitch Bug reports: https://github.com/randyzwitch/RSiteCatalyst -__OK__ +``` +checking tests ... ERROR +Running the tests in ‘tests/testthat.R’ failed. +Last 13 lines of output: + 4: expect_output(SCAuth(Sys.getenv("USER", ""), Sys.getenv("SECRET", "")), "Authentication Succeeded.") at test-scauth.R:6 + 5: expect_that(object, prints_text(regexp, ...), info = info, label = label) + 6: condition(object) + 7: evaluate_promise(expr, print = TRUE) + 8: with_sink(temp, withCallingHandlers(withVisible(code), warning = wHandler, message = mHandler)) + 9: withCallingHandlers(withVisible(code), warning = wHandler, message = mHandler) + 10: withVisible(code) + 11: SCAuth(Sys.getenv("USER", ""), Sys.getenv("SECRET", "")) + 12: stop("Authentication failed due to errors") + + Error: Test failures + In addition: There were 50 or more warnings (use warnings() to see the first 50) + Execution halted +``` -## rsnps (0.1.0) +## rsnps (0.1.6) Maintainer: Scott Chamberlain Bug reports: https://github.com/ropensci/rsnps/issues @@ -1750,8 +1789,6 @@ Packages in Depends field not imported from: ‘car’ ‘stringr’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. ``` ``` checking R code for possible problems ... NOTE @@ -1768,15 +1805,15 @@ Maintainer: James Keirstead __OK__ -## sdcTable (0.17.1) +## sdcTable (0.18.0) Maintainer: Bernhard Meindl ``` checking package dependencies ... ERROR Packages required but not available: ‘Rglpk’ ‘lpSolveAPI’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` ## selectr (0.2-3) @@ -1790,17 +1827,11 @@ Maintainer: Xiaowei Zhan __OK__ -## simPH (1.2.4) +## simPH (1.3) Maintainer: Christopher Gandrud Bug reports: https://github.com/christophergandrud/simPH/issues -``` -checking package dependencies ... ERROR -Package required and available but unsuitable version: ‘stringr’ - -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. -``` +__OK__ ## spanr (1.0) Maintainer: Roger Marshall @@ -1808,13 +1839,16 @@ Maintainer: Roger Marshall ``` checking whether package ‘spanr’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/spanr.Rcheck/00install.out’ for details. +See ‘/private/tmp/Rtmph7PUNf/check_cran8a7e788398cb/spanr.Rcheck/00install.out’ for details. ``` ## spatsurv (0.9-8) Maintainer: Benjamin M. Taylor -__OK__ +``` +checking package dependencies ... NOTE +Package suggested but not available for checking: ‘rgdal’ +``` ## sqliter (0.1.0) Maintainer: Wilson Freitas @@ -1828,13 +1862,14 @@ Bug reports: https://github.com/jbryer/sqlutils/issues ``` checking package dependencies ... NOTE Packages which this enhances but not available for checking: - ‘RPostgreSQL’ ‘RODBC’ ‘RMySQL’ + ‘RPostgreSQL’ ‘RODBC’ ``` ``` checking dependencies in R code ... NOTE -No Java runtime present, requesting install. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +'library' or 'require' calls in package code: + ‘RJDBC’ ‘RMySQL’ ‘RODBC’ ‘RPostgreSQL’ ‘RSQLite’ ‘tcltk’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. ``` ## srd (1.0) @@ -1843,7 +1878,7 @@ Maintainer: Roger Marshall ``` checking whether package ‘srd’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/srd.Rcheck/00install.out’ for details. +See ‘/private/tmp/Rtmph7PUNf/check_cran8a7e788398cb/srd.Rcheck/00install.out’ for details. ``` ## ssh.utils (1.0) @@ -1856,7 +1891,7 @@ Maintainer: Mike Malecki __OK__ -## statar (0.1.2) +## statar (0.1.3) Maintainer: Matthieu Gomez Bug reports: https://github.com/matthieugomez/statar/issues @@ -1868,26 +1903,6 @@ Maintainer: Brandon Stewart ``` checking dependencies in R code ... NOTE Missing or unexported object: ‘tm::meta’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. -``` -``` -checking re-building of vignette outputs ... NOTE -Error in re-building vignettes: - ... -stm v1.0.8 (2014-11-07) successfully loaded. See ?stm for help. -Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet, : - Running 'texi2dvi' on 'stmVignette.tex' failed. -LaTeX errors: -s/stmVignette.tex:96: pdfTeX error (ext4): \pdfendlink ended up in different ne -sting level than \pdfstartlink. -\AtBegShi@Output ...ipout \box \AtBeginShipoutBox - \fi \fi -l.96 \end{itemize} -s/stmVignette.tex:96: ==> Fatal error occurred, no output PDF file produced! -Calls: buildVignettes -> texi2pdf -> texi2dvi -Execution halted - ``` ## surveydata (0.1-14) @@ -1903,6 +1918,13 @@ __OK__ ## taRifx (1.0.6) Maintainer: Ari B. Friedman +``` +checking dependencies in R code ... NOTE +'library' or 'require' calls in package code: + ‘gdata’ ‘ggplot2’ ‘grid’ ‘lattice’ ‘xtable’ + Please use :: or requireNamespace() instead. + See section 'Suggested packages' in the 'Writing R Extensions' manual. +``` ``` checking R code for possible problems ... NOTE autoplot.microbenchmark: no visible global function definition for @@ -1984,19 +2006,15 @@ __OK__ Maintainer: Boris P. Hejblum ``` -checking R code for possible problems ... NOTE -TcGSA.LR.parallel: no visible global function definition for - ‘makeCluster’ -TcGSA.LR.parallel: no visible global function definition for - ‘registerDoSNOW’ -TcGSA.LR.parallel: no visible global function definition for ‘%dopar%’ -TcGSA.LR.parallel: no visible global function definition for ‘foreach’ -TcGSA.LR.parallel: no visible global function definition for - ‘stopCluster’ -``` - -## tikzDevice (0.7.0) -Maintainer: Kirill Mueller +checking package dependencies ... ERROR +Package required but not available: ‘multtest’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +``` + +## tikzDevice (0.8.1) +Maintainer: Kirill Müller Bug reports: https://github.com/yihui/tikzDevice/issues __OK__ @@ -2005,9 +2023,18 @@ __OK__ Maintainer: Bernd Bischl Bug reports: https://github.com/berndbischl/tspmeta/issues -__OK__ +``` +checking S3 generic/method consistency ... WARNING +tour_length: + function(x, ...) +tour_length.tsp_instance: + function(x, order) + +See section ‘Generic functions and methods’ in the ‘Writing R +Extensions’ manual. +``` -## tumblR (1.0) +## tumblR (1.1) Maintainer: Andrea Capozio __OK__ @@ -2017,7 +2044,7 @@ Maintainer: Steven Pollack __OK__ -## vardpoor (0.2.4) +## vardpoor (0.2.8) Maintainer: Juris Breidaks Bug reports: https://github.com/CSBLatvia/vardpoor/issues/ @@ -2029,7 +2056,7 @@ Bug reports: https://github.com/talassio/vetools/issues __OK__ -## vows (0.3) +## vows (0.4) Maintainer: Philip Reiss __OK__ @@ -2047,8 +2074,6 @@ checking dependencies in R code ... NOTE Package in Depends field not imported from: ‘parallel’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. ``` ``` checking R code for possible problems ... NOTE @@ -2074,25 +2099,28 @@ File ‘wsrf/libs/wsrf.so’: ‘random_forests.o’ Compiled code should not call entry points which might terminate R nor -write to stdout/stderr instead of to the console, nor the C RNG. +write to stdout/stderr instead of to the console, nor the system RNG. See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual. ``` -## wux (1.2-2) +## wux (2.0-0) Maintainer: Thomas Mendlik -__OK__ - -## x.ent (1.0.6) -Maintainer: Tien T. Phan - ``` -checking whether package ‘x.ent’ can be installed ... ERROR -Installation failed. -See ‘/private/tmp/Rtmpt0cEnG/check_crand447fed5470/x.ent.Rcheck/00install.out’ for details. +checking package dependencies ... ERROR +Packages required but not available: ‘ncdf’ ‘rgdal’ ‘rgeos’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` +## x.ent (1.1.2) +Maintainer: Tien T. Phan +Bug reports: https://github.com/tienpt/x.ent/issues + +__OK__ + ## x12 (1.6.0) Maintainer: Alexander Kowarik @@ -2105,11 +2133,11 @@ Maintainer: Alexander Kowarik checking package dependencies ... ERROR Packages required but not available: ‘x12’ ‘RGtk2’ ‘cairoDevice’ -See the information on DESCRIPTION files in the chapter ‘Creating R -packages’ of the ‘Writing R Extensions’ manual. +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. ``` -## yhatr (0.13.2) +## yhatr (0.13.4) Maintainer: Greg Lamp __OK__ From 777a8643057dca6f10720613da2bece7abbcb810 Mon Sep 17 00:00:00 2001 From: hadley Date: Wed, 15 Apr 2015 06:55:51 -0500 Subject: [PATCH 04/44] Preparing for release --- DESCRIPTION | 2 +- NEWS.md | 2 +- cran-comments.md | 3 +-- revdep/check.R | 2 ++ revdep/summary.md | 42 ++++++++++++++---------------------------- 5 files changed, 19 insertions(+), 32 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index bc7befaa..c0dc8b7d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: stringr -Version: 0.9.0.9000 +Version: 1.0.0 Title: Simple, Consistent Wrappers for Common String Operations. Description: A consistent, simple and easy to use set of wrappers around the fantastic stringi package. All function and argument names (and positions) diff --git a/NEWS.md b/NEWS.md index 1a586045..5bba85d0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# stringr 0.9.0.9000 +# stringr 1.0.0 * stringr is now powered by [stringi](https://github.com/Rexamine/stringi) instead of base R regular expressions. This improves unicode and support, and diff --git a/cran-comments.md b/cran-comments.md index a9b17688..e93ffbfc 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -13,5 +13,4 @@ package. The potential for backward incompatible changes was high so I have R CMD check on all 155 downstream dependencies (https://github.com/hadley/stringr/blob/master/revdep/summary.md). As well as carefully reviewing the results, I notified all downstream maintainers -of the pending change in early Dec, giving them a lot of time to check their -packages and make changes. +of the pending change in early Dec and again on April 14. diff --git a/revdep/check.R b/revdep/check.R index e8592f09..4d904e89 100644 --- a/revdep/check.R +++ b/revdep/check.R @@ -1,5 +1,7 @@ library("devtools") +install.packages(c("RcppEigen", "RcppArmadillo"), lib = "~/R-revdep") +install.packages("rgeos", lib = "~/R-revdep", type = "source") res <- revdep_check() install.packages("stringr", lib = "~/R-revdep") # because it's otherwise deleted diff --git a/revdep/summary.md b/revdep/summary.md index 13cb177a..86b1eb67 100644 --- a/revdep/summary.md +++ b/revdep/summary.md @@ -128,13 +128,7 @@ __OK__ Maintainer: Richard D. Morey Bug reports: https://github.com/richarddmorey/BayesFactor/issues -``` -checking package dependencies ... ERROR -Package required but not available: ‘RcppEigen’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -``` +__OK__ ## beepr (1.1) Maintainer: Rasmus Bååth @@ -319,7 +313,7 @@ Maintainer: John Waller ``` checking whether package ‘EasyMARK’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/Rtmph7PUNf/check_cran8a7e788398cb/EasyMARK.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/EasyMARK.Rcheck/00install.out’ for details. ``` ## eeptools (0.3.1) @@ -564,11 +558,9 @@ __OK__ Maintainer: Jose Gerardo Tamez-Pena ``` -checking package dependencies ... ERROR -Package required but not available: ‘RcppArmadillo’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. +checking whether package ‘FRESA.CAD’ can be installed ... [27s/28s] ERROR +Installation failed. +See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/FRESA.CAD.Rcheck/00install.out’ for details. ``` ## fslr (1.3) @@ -582,7 +574,7 @@ Maintainer: Nikolai Gorte ``` checking package dependencies ... ERROR -Packages required but not available: ‘osmar’ ‘frbs’ ‘rgeos’ ‘rgdal’ +Packages required but not available: ‘osmar’ ‘frbs’ ‘rgdal’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. @@ -619,7 +611,7 @@ Bug reports: https://github.com/azvoleff/gfcanalysis/issues ``` checking package dependencies ... ERROR -Packages required but not available: ‘rgdal’ ‘rgeos’ ‘rasterVis’ +Packages required but not available: ‘rgdal’ ‘rasterVis’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. @@ -929,7 +921,7 @@ Maintainer: Jonathan Callahan ``` checking package dependencies ... ERROR -Packages required but not available: ‘rgdal’ ‘rgeos’ +Package required but not available: ‘rgdal’ Package suggested but not available for checking: ‘ISOcodes’ @@ -1529,7 +1521,7 @@ Bug reports: http://github.com/renozao/RcppOctave/issues ``` checking whether package ‘RcppOctave’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/Rtmph7PUNf/check_cran8a7e788398cb/RcppOctave.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/RcppOctave.Rcheck/00install.out’ for details. ``` ## rdryad (0.1.1) @@ -1609,13 +1601,7 @@ __OK__ Maintainer: Scott Chamberlain Bug reports: https://github.com/ropensci/rgbif/issues -``` -checking package dependencies ... ERROR -Package required but not available: ‘rgeos’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -``` +__OK__ ## RGENERATEPREC (1.0) Maintainer: Emanuele Cordano @@ -1683,7 +1669,7 @@ Bug reports: http://www.github.com/ropensci/rnoaa/issues ``` checking package dependencies ... ERROR -Packages required but not available: ‘rgdal’ ‘rgeos’ +Package required but not available: ‘rgdal’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. @@ -1839,7 +1825,7 @@ Maintainer: Roger Marshall ``` checking whether package ‘spanr’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/Rtmph7PUNf/check_cran8a7e788398cb/spanr.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/spanr.Rcheck/00install.out’ for details. ``` ## spatsurv (0.9-8) @@ -1878,7 +1864,7 @@ Maintainer: Roger Marshall ``` checking whether package ‘srd’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/Rtmph7PUNf/check_cran8a7e788398cb/srd.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/srd.Rcheck/00install.out’ for details. ``` ## ssh.utils (1.0) @@ -2109,7 +2095,7 @@ Maintainer: Thomas Mendlik ``` checking package dependencies ... ERROR -Packages required but not available: ‘ncdf’ ‘rgdal’ ‘rgeos’ +Packages required but not available: ‘ncdf’ ‘rgdal’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. From 3b137584a22dc96cf966e3fcd6b13b39bafd94cf Mon Sep 17 00:00:00 2001 From: hadley Date: Wed, 15 Apr 2015 07:52:41 -0500 Subject: [PATCH 05/44] Use cg_missing in str_match too. --- R/match.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/match.r b/R/match.r index c911ae85..3f1f032b 100644 --- a/R/match.r +++ b/R/match.r @@ -28,7 +28,7 @@ str_match <- function(string, pattern) { switch(type(pattern), regex = stri_match_first_regex(string, pattern, - opts_regex = attr(pattern, "options")), + opts_regex = attr(pattern, "options"), cg_missing = ""), stop("Can only match regular expressions", call. = FALSE) ) } From c705285aef8825f3d679de2fc494e47f7c1e1fdf Mon Sep 17 00:00:00 2001 From: hadley Date: Wed, 15 Apr 2015 13:41:55 -0500 Subject: [PATCH 06/44] Summary when returning "" for no match --- revdep/summary.md | 85 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 12 deletions(-) diff --git a/revdep/summary.md b/revdep/summary.md index 86b1eb67..46ffb85b 100644 --- a/revdep/summary.md +++ b/revdep/summary.md @@ -18,7 +18,7 @@ |knitr |* |1.9 |2015-01-20 |CRAN (R 3.1.2) | |magrittr |* |1.5 |2014-11-22 |CRAN (R 3.1.2) | |stringi |* |0.4-1 |2014-12-14 |CRAN (R 3.1.2) | -|stringr |* |0.6.2 |2012-12-06 |CRAN (R 3.1.2) | +|stringr | |0.6.2 |2012-12-06 |CRAN (R 3.1.2) | |testthat | |0.9.1 |2014-10-01 |CRAN (R 3.1.2) | # Check results @@ -297,7 +297,32 @@ __OK__ ## docopt (0.4.2) Maintainer: Edwin de Jonge -__OK__ +``` +checking examples ... ERROR +Running examples in ‘docopt-Ex.R’ failed +The error most likely occurred in: + +> base::assign(".ptime", proc.time(), pos = "CheckExEnv") +> ### Name: docopt +> ### Title: Parse 'args' based on command-line interface described in 'doc'. +> ### Aliases: docopt +> +> ### ** Examples +> +> "Usage: my_program.R [-hso FILE] [--quiet | --verbose] [INPUT ...] ++ ++ -h --help show this ++ -s --sorted sorted output ++ -o FILE specify output file [default: ./test.txt] ++ --quiet print less text ++ --verbose print more text" -> doc +> docopt(doc, "-s --quiet") +perl is deprecated. Please use regexp instead +perl is deprecated. Please use regexp instead +Error in parse_long(tokens, optionlist) : is specified ambigously +Calls: docopt -> parse_args -> parse_long -> +Execution halted +``` ## dplR (1.6.2) Maintainer: Andy Bunn @@ -313,7 +338,7 @@ Maintainer: John Waller ``` checking whether package ‘EasyMARK’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/EasyMARK.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/EasyMARK.Rcheck/00install.out’ for details. ``` ## eeptools (0.3.1) @@ -558,9 +583,9 @@ __OK__ Maintainer: Jose Gerardo Tamez-Pena ``` -checking whether package ‘FRESA.CAD’ can be installed ... [27s/28s] ERROR +checking whether package ‘FRESA.CAD’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/FRESA.CAD.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/FRESA.CAD.Rcheck/00install.out’ for details. ``` ## fslr (1.3) @@ -802,6 +827,24 @@ Bug reports: https://bitbucket.org/djhshih/io/issues checking package dependencies ... NOTE Package suggested but not available for checking: ‘rhdf5’ ``` +``` +checking tests ... ERROR +Running the tests in ‘tests/testthat.R’ failed. +Last 13 lines of output: + 7 string mismatches + + 2. Failure(@/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/io.Rcheck/tests/testthat/helper.R#71): write-and-read does not change data + x not equal to y + Names: 2 string mismatches + + 3. Failure(@/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/io.Rcheck/tests/testthat/helper.R#91): write to text connection does not change content + inlines not equal to textlines + Lengths (7, 8) differ (string compare on first 7) + 7 string mismatches + + Error: Test failures + Execution halted +``` ## ISOweek (0.6-2) Maintainer: Uwe Block @@ -1187,9 +1230,10 @@ The error most likely occurred in: > res <- nmf(V, 3) > > basismap(res) -Error in process_tracks(x, tracks, annRow, annCol) : - Invalid special annotation track name ['basis']. Should partially match one of 'basis', ':basis', 'basis:'. -Calls: basismap -> basismap -> .local -> process_tracks +Error in ccPalette(x, ...) : + Invalid palette name '': should be an RColorBrewer palette or one of 'RdYlBu2', 'rainbow', 'heat', 'topo', 'terrain', 'cm', 'gray', 'grey'. + Available RColorBrewer palettes: 'BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'Accent', 'Dark2', 'Paired', 'Pastel1', 'Pastel2', 'Set1', 'Set2', 'Set3', 'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd'. +Calls: basismap ... basismap -> .local -> aheatmap -> ccRamp -> ccPalette Execution halted ``` @@ -1521,7 +1565,7 @@ Bug reports: http://github.com/renozao/RcppOctave/issues ``` checking whether package ‘RcppOctave’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/RcppOctave.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/RcppOctave.Rcheck/00install.out’ for details. ``` ## rdryad (0.1.1) @@ -1806,7 +1850,24 @@ manual. Maintainer: Simon Potter Bug reports: https://github.com/sjp/selectr/issues -__OK__ +``` +checking tests ... ERROR +Running the tests in ‘tests/test-all.R’ failed. +Last 13 lines of output: + y[1]: "Element[]" + + + + Z. Failure(@test-pseudo.R#36): parser parses canonical pseudo element expressions + parse_one("*") not equal to list("Element[*]", NULL) + Component 1: 1 string mismatch + + Error: Test failures + In addition: Warning message: + In mapply(FUN = f, ..., SIMPLIFY = FALSE) : + longer argument not a multiple of length of shorter + Execution halted +``` ## seqminer (3.4) Maintainer: Xiaowei Zhan @@ -1825,7 +1886,7 @@ Maintainer: Roger Marshall ``` checking whether package ‘spanr’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/spanr.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/spanr.Rcheck/00install.out’ for details. ``` ## spatsurv (0.9-8) @@ -1864,7 +1925,7 @@ Maintainer: Roger Marshall ``` checking whether package ‘srd’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmppTodh4/check_cran11828875e07f/srd.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/srd.Rcheck/00install.out’ for details. ``` ## ssh.utils (1.0) From c9f617ceeef6406bab27fe8c6d6bd39d55fbbae7 Mon Sep 17 00:00:00 2001 From: hadley Date: Wed, 15 Apr 2015 15:34:23 -0500 Subject: [PATCH 07/44] Clarify result when optional group doesn't match --- NEWS.md | 4 ++ R/match.r | 15 +++++-- revdep/summary.md | 81 +++++-------------------------------- tests/testthat/test-match.r | 6 ++- 4 files changed, 31 insertions(+), 75 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5bba85d0..7979682a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -22,6 +22,10 @@ str_replace_all(input, c("[ad]" = "!", "[cf]" = "?")) ``` +* `str_match()` now returns NA if an optional group doesn't match + (previously it returned ""). This is more consistent with `str_extract()` + and other match failures. + * New `str_subset()` keeps values that match a pattern. It's a convenient wrapper for `x[str_detect(x)]` (#21, @jiho). diff --git a/R/match.r b/R/match.r index 3f1f032b..03846c75 100644 --- a/R/match.r +++ b/R/match.r @@ -8,6 +8,7 @@ #' @return For \code{str_match}, a character matrix. First column is the #' complete match, followed by one column for each capture group. #' For \code{str_match_all}, a list of character matrices. +#' #' @seealso \code{\link{str_extract}} to extract the complete match, #' \code{\link[stringi]{stri_match}} for the underlying #' implementation. @@ -25,10 +26,17 @@ #' # Extract/match all #' str_extract_all(strings, phone) #' str_match_all(strings, phone) +#' +#' x <- c(" ", " <>", "", "", NA) +#' str_match(x, "<(.*?)> <(.*?)>") +#' str_match_all(x, "<(.*?)>") +#' +#' str_extract(x, "<.*?>") +#' str_extract_all(x, "<.*?>") str_match <- function(string, pattern) { switch(type(pattern), regex = stri_match_first_regex(string, pattern, - opts_regex = attr(pattern, "options"), cg_missing = ""), + opts_regex = attr(pattern, "options")), stop("Can only match regular expressions", call. = FALSE) ) } @@ -38,8 +46,9 @@ str_match <- function(string, pattern) { str_match_all <- function(string, pattern) { switch(type(pattern), regex = stri_match_all_regex(string, pattern, - omit_no_match = TRUE, opts_regex = attr(pattern, "options"), - cg_missing = ""), + cg_missing = "", + omit_no_match = TRUE, + opts_regex = attr(pattern, "options")), stop("Can only match regular expressions", call. = FALSE) ) } diff --git a/revdep/summary.md b/revdep/summary.md index 46ffb85b..72b8c3af 100644 --- a/revdep/summary.md +++ b/revdep/summary.md @@ -297,32 +297,7 @@ __OK__ ## docopt (0.4.2) Maintainer: Edwin de Jonge -``` -checking examples ... ERROR -Running examples in ‘docopt-Ex.R’ failed -The error most likely occurred in: - -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: docopt -> ### Title: Parse 'args' based on command-line interface described in 'doc'. -> ### Aliases: docopt -> -> ### ** Examples -> -> "Usage: my_program.R [-hso FILE] [--quiet | --verbose] [INPUT ...] -+ -+ -h --help show this -+ -s --sorted sorted output -+ -o FILE specify output file [default: ./test.txt] -+ --quiet print less text -+ --verbose print more text" -> doc -> docopt(doc, "-s --quiet") -perl is deprecated. Please use regexp instead -perl is deprecated. Please use regexp instead -Error in parse_long(tokens, optionlist) : is specified ambigously -Calls: docopt -> parse_args -> parse_long -> -Execution halted -``` +__OK__ ## dplR (1.6.2) Maintainer: Andy Bunn @@ -338,7 +313,7 @@ Maintainer: John Waller ``` checking whether package ‘EasyMARK’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/EasyMARK.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/EasyMARK.Rcheck/00install.out’ for details. ``` ## eeptools (0.3.1) @@ -585,7 +560,7 @@ Maintainer: Jose Gerardo Tamez-Pena ``` checking whether package ‘FRESA.CAD’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/FRESA.CAD.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/FRESA.CAD.Rcheck/00install.out’ for details. ``` ## fslr (1.3) @@ -827,24 +802,6 @@ Bug reports: https://bitbucket.org/djhshih/io/issues checking package dependencies ... NOTE Package suggested but not available for checking: ‘rhdf5’ ``` -``` -checking tests ... ERROR -Running the tests in ‘tests/testthat.R’ failed. -Last 13 lines of output: - 7 string mismatches - - 2. Failure(@/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/io.Rcheck/tests/testthat/helper.R#71): write-and-read does not change data - x not equal to y - Names: 2 string mismatches - - 3. Failure(@/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/io.Rcheck/tests/testthat/helper.R#91): write to text connection does not change content - inlines not equal to textlines - Lengths (7, 8) differ (string compare on first 7) - 7 string mismatches - - Error: Test failures - Execution halted -``` ## ISOweek (0.6-2) Maintainer: Uwe Block @@ -1230,10 +1187,9 @@ The error most likely occurred in: > res <- nmf(V, 3) > > basismap(res) -Error in ccPalette(x, ...) : - Invalid palette name '': should be an RColorBrewer palette or one of 'RdYlBu2', 'rainbow', 'heat', 'topo', 'terrain', 'cm', 'gray', 'grey'. - Available RColorBrewer palettes: 'BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'Accent', 'Dark2', 'Paired', 'Pastel1', 'Pastel2', 'Set1', 'Set2', 'Set3', 'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd'. -Calls: basismap ... basismap -> .local -> aheatmap -> ccRamp -> ccPalette +Error in process_tracks(x, tracks, annRow, annCol) : + Invalid special annotation track name ['basis']. Should partially match one of 'basis', ':basis', 'basis:'. +Calls: basismap -> basismap -> .local -> process_tracks Execution halted ``` @@ -1565,7 +1521,7 @@ Bug reports: http://github.com/renozao/RcppOctave/issues ``` checking whether package ‘RcppOctave’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/RcppOctave.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/RcppOctave.Rcheck/00install.out’ for details. ``` ## rdryad (0.1.1) @@ -1850,24 +1806,7 @@ manual. Maintainer: Simon Potter Bug reports: https://github.com/sjp/selectr/issues -``` -checking tests ... ERROR -Running the tests in ‘tests/test-all.R’ failed. -Last 13 lines of output: - y[1]: "Element[]" - - - - Z. Failure(@test-pseudo.R#36): parser parses canonical pseudo element expressions - parse_one("*") not equal to list("Element[*]", NULL) - Component 1: 1 string mismatch - - Error: Test failures - In addition: Warning message: - In mapply(FUN = f, ..., SIMPLIFY = FALSE) : - longer argument not a multiple of length of shorter - Execution halted -``` +__OK__ ## seqminer (3.4) Maintainer: Xiaowei Zhan @@ -1886,7 +1825,7 @@ Maintainer: Roger Marshall ``` checking whether package ‘spanr’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/spanr.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/spanr.Rcheck/00install.out’ for details. ``` ## spatsurv (0.9-8) @@ -1925,7 +1864,7 @@ Maintainer: Roger Marshall ``` checking whether package ‘srd’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f22e9b2abb/srd.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/srd.Rcheck/00install.out’ for details. ``` ## ssh.utils (1.0) diff --git a/tests/testthat/test-match.r b/tests/testthat/test-match.r index 28ba2b14..33c31e2d 100644 --- a/tests/testthat/test-match.r +++ b/tests/testthat/test-match.r @@ -35,7 +35,7 @@ test_that("single match works when all match", { expect_that(matches_flat, equals(num_flat)) }) -test_that("single match works when some don't match", { +test_that("match returns NA when some inputs don't match", { matches <- str_match(c(phones, "blah", NA), "\\(([0-9]{3})\\) ([0-9]{3}) ([0-9]{4})") @@ -46,6 +46,10 @@ test_that("single match works when some don't match", { expect_that(matches[12, ], equals(rep(NA_character_, 4))) }) +test_that("match returns NA when optional group doesn't match", { + expect_equal(str_match(c("ab", "a"), "(a)(b)?")[,3], c("b", NA)) +}) + test_that("multiple match works", { phones_one <- str_c(phones, collapse = " ") multi_match <- str_match_all(phones_one, From 855fd343f476564f58de4422edbb84d41aa6488e Mon Sep 17 00:00:00 2001 From: hadley Date: Tue, 28 Apr 2015 16:27:51 -0500 Subject: [PATCH 08/44] Final revdep checks --- cran-comments.md | 27 +- revdep/check.R | 2 + revdep/summary.md | 989 ++++++++++++++++++++++++++++++++++------------ 3 files changed, 763 insertions(+), 255 deletions(-) diff --git a/cran-comments.md b/cran-comments.md index e93ffbfc..fe87ede0 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,6 @@ ## Test environments -* local OS X install, R 3.1.2 -* ubuntu 12.04 (on travis-ci), R 3.1.2 +* local OS X install, R 3.2.0 +* ubuntu 12.04 (on travis-ci), R 3.2.0 * win-builder (devel and release) ## R CMD check results @@ -8,9 +8,20 @@ There were no ERRORs, WARNINGs or NOTEs. ## Downstream dependencies This release changes the backend of stringr from R's built in regular -expression engine to use instead use ICU's, as provided by the stringi -package. The potential for backward incompatible changes was high so I have -R CMD check on all 155 downstream dependencies -(https://github.com/hadley/stringr/blob/master/revdep/summary.md). As well -as carefully reviewing the results, I notified all downstream maintainers -of the pending change in early Dec and again on April 14. +expression engine to ICU's, as provided by the stringi package. The potential +for backward incompatible changes was high so I have R CMD check on all 158 +downstream dependencies (https://github.com/hadley/stringr/blob/master/revdep/summary.md). + +All downstream maintainers (both en masse, and individually in the case of +problems) were notified of the change in early Dec and again on April 14 +(two weeks ago). + +Despite these warnings, I have identifed six packages that now fail R CMD +check with either an error or a warning: + +* Errors: CSS, mpoly, NMF, pathological, rlme +* Warnings: MazamaSpatialUtils + +Two other packages failed with non-installed-related errors (RSiteCatalyst, +REDCapR). Judging from the error messages, I don't believe these failures +at related to stringr. diff --git a/revdep/check.R b/revdep/check.R index 4d904e89..8ffc9b73 100644 --- a/revdep/check.R +++ b/revdep/check.R @@ -1,5 +1,7 @@ library("devtools") +dr_devtools() + install.packages(c("RcppEigen", "RcppArmadillo"), lib = "~/R-revdep") install.packages("rgeos", lib = "~/R-revdep", type = "source") res <- revdep_check() diff --git a/revdep/summary.md b/revdep/summary.md index 72b8c3af..f34f394f 100644 --- a/revdep/summary.md +++ b/revdep/summary.md @@ -4,9 +4,9 @@ |setting |value | |:--------|:----------------------------| -|version |R version 3.1.3 (2015-03-09) | +|version |R version 3.2.0 (2015-04-16) | |system |x86_64, darwin13.4.0 | -|ui |RStudio (0.99.380) | +|ui |RStudio (0.99.399) | |language |(EN) | |collate |en_US.UTF-8 | |tz |America/Chicago | @@ -15,18 +15,25 @@ |package |* |version |date |source | |:--------|:--|:-------|:----------|:--------------| -|knitr |* |1.9 |2015-01-20 |CRAN (R 3.1.2) | -|magrittr |* |1.5 |2014-11-22 |CRAN (R 3.1.2) | -|stringi |* |0.4-1 |2014-12-14 |CRAN (R 3.1.2) | -|stringr | |0.6.2 |2012-12-06 |CRAN (R 3.1.2) | -|testthat | |0.9.1 |2014-10-01 |CRAN (R 3.1.2) | +|knitr |* |1.10 |2015-04-23 |CRAN (R 3.2.0) | +|magrittr |* |1.5 |2014-11-22 |CRAN (R 3.2.0) | +|stringi |* |0.4-1 |2014-12-14 |CRAN (R 3.2.0) | +|stringr |* |0.6.2 |2012-12-06 |CRAN (R 3.2.0) | +|testthat | |0.9.1 |2014-10-01 |CRAN (R 3.2.0) | # Check results -155 checked out of 155 dependencies +158 checked out of 158 dependencies ## acs (1.2) Maintainer: Ezra Haber Glenn +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + confint.acs dim.acs length.acs prompt.acs +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` ``` checking R code for possible problems ... NOTE geo.lookup: no visible binding for global variable ‘fips.state’ @@ -46,6 +53,10 @@ geo.make : .geo.unit.make: no visible binding for global variable geo.make : .geo.unit.make: no visible binding for global variable ‘fips.school’ ``` +``` +DONE +Status: 2 NOTEs +``` ## aemo (0.1.0) Maintainer: Imanuel Costigan @@ -55,18 +66,42 @@ __OK__ ## afex (0.13-145) Maintainer: Henrik Singmann -__OK__ +``` +checking Rd cross-references ... NOTE +Package unavailable to check Rd xrefs: ‘ez’ +``` +``` +DONE +Status: 1 NOTE +``` ## algstat (0.0.2) Maintainer: David Kahle -__OK__ +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + print.spectral +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` +``` +DONE +Status: 1 NOTE +``` ## alm (0.4.0) Maintainer: Scott Chamberlain Bug reports: http://www.github.com/ropensci/alm/issues -__OK__ +``` +checking package dependencies ... NOTE +Package suggested but not available for checking: ‘rplos’ +``` +``` +DONE +Status: 1 NOTE +``` ## AnDE (1.0) Maintainer: Sai Teja Ranuva @@ -89,34 +124,15 @@ aode: no visible global function definition for ‘Compose’ mdl: no visible global function definition for ‘cutPoints’ setVar: no visible global function definition for ‘Compose’ ``` - -## aqp (1.8) -Maintainer: Dylan Beaudette - -``` -checking package dependencies ... NOTE -Packages suggested but not available for checking: ‘soilDB’ ‘compositions’ ``` +DONE +Status: 3 NOTEs ``` -checking examples ... ERROR -Running examples in ‘aqp-Ex.R’ failed -The error most likely occurred in: -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: addVolumeFraction -> ### Title: Symbolize Volume Fraction on a Soil Profile Collection Plot -> ### Aliases: addVolumeFraction -> ### Keywords: ~kwd1 -> -> ### ** Examples -> -> # sample data -> data(loafercreek, package='soilDB') -Error in find.package(package, lib.loc, verbose = verbose) : - there is no package called ‘soilDB’ -Calls: data -> find.package -Execution halted -``` +## aqp (1.8-6) +Maintainer: Dylan Beaudette + +__OK__ ## BatchJobs (1.6) Maintainer: Bernd Bischl @@ -142,16 +158,40 @@ Maintainer: Dirk Schumacher checking data for non-ASCII characters ... NOTE Note: found 1 marked UTF-8 string ``` +``` +DONE +Status: 1 NOTE +``` -## bold (0.2.0) +## bold (0.2.6) Maintainer: Scott Chamberlain Bug reports: https://github.com/ropensci/bold/issues -__OK__ +``` +checking package dependencies ... NOTE +Package suggested but not available for checking: ‘sangerseqR’ +``` +``` +DONE +Status: 1 NOTE +``` ## boostr (1.0.0) Maintainer: Steven Pollack +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` + +## boxr (0.2.5) +Maintainer: Brendan Rocks +Bug reports: https://github.com/brendan-R/boxr/issues + __OK__ ## broom (0.3.6) @@ -164,28 +204,12 @@ __OK__ Maintainer: Justin Hemann ``` -checking top-level files ... NOTE -Non-standard file/directory found at top level: - ‘integration_tests’ -``` -``` -checking R code for possible problems ... NOTE -GetMetadata.Connect: no visible global function definition for - ‘dbGetQuery’ -GetRawData.Connect: no visible global function definition for - ‘dbGetQuery’ -``` -``` -checking line endings in Makefiles ... NOTE -Found the following Makefile(s) without a final LF: - inst/doc/Makefile -Some ‘make’ programs ignore lines not ending in LF. -``` -``` -checking files in ‘vignettes’ ... NOTE -The following files look like leftovers/mistakes: - ‘Causata-vignette.log’ -Please remove them from your package. +checking package dependencies ... ERROR +Package required but not available: ‘R.utils’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +Status: 1 ERROR ``` ## choroplethr (3.0.0) @@ -203,7 +227,14 @@ __OK__ Maintainer: Casey M. Jelsema Bug reports: https://github.com/jelsema/CLME/issues -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## commentr (0.1) Maintainer: Erik Bulow @@ -274,9 +305,14 @@ Last 13 lines of output: Error: Test failures Execution halted ``` +``` +DONE +Status: 1 ERROR, 2 NOTEs +``` -## datacheck (1.0.4) -Maintainer: "Simon, Reinhard (CIP)" +## datacheck (1.2.2) +Maintainer: "Simon, Reinhard (CIP)" +Bug reports: https://github.com/c5sire/datacheck/issues __OK__ @@ -288,6 +324,10 @@ Bug reports: https://github.com/yhat/db.r/issues checking package dependencies ... NOTE Package suggested but not available for checking: ‘RPostgreSQL’ ``` +``` +DONE +Status: 1 NOTE +``` ## decctools (0.2.0) Maintainer: James Keirstead @@ -306,6 +346,14 @@ Maintainer: Andy Bunn checking package dependencies ... NOTE Package suggested but not available for checking: ‘Biobase’ ``` +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 2 NOTEs +``` ## EasyMARK (1.0) Maintainer: John Waller @@ -313,7 +361,8 @@ Maintainer: John Waller ``` checking whether package ‘EasyMARK’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/EasyMARK.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpIfPui2/check_cranab52a249f14/EasyMARK.Rcheck/00install.out’ for details. +Status: 1 ERROR ``` ## eeptools (0.3.1) @@ -323,11 +372,22 @@ Maintainer: Jared E. Knowles checking R code for possible problems ... NOTE moves_calc: no visible binding for global variable ‘id’ ``` +``` +DONE +Status: 1 NOTE +``` ## enaR (2.8.1) Maintainer: Matthew K. Lau -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## eqs2lavaan (3.0) Maintainer: Craig M. Krebsbach @@ -336,8 +396,12 @@ Maintainer: Craig M. Krebsbach checking R code for possible problems ... NOTE eqs2lavaan: no visible binding for global variable ‘r’ ``` +``` +DONE +Status: 1 NOTE +``` -## evaluate (0.6) +## evaluate (0.7) Maintainer: Yihui Xie Bug reports: https://github.com/hadley/evaluate/issues @@ -346,6 +410,11 @@ __OK__ ## evobiR (1.0) Maintainer: Heath Blackmon +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +Malformed Description field: should contain one or more complete sentences. +``` ``` checking dependencies in R code ... NOTE Packages in Depends field not imported from: @@ -368,6 +437,10 @@ SampleTrees: no visible global function definition for ‘read.nexus’ SampleTrees: no visible global function definition for ‘write.tree’ SampleTrees: no visible global function definition for ‘write.nexus’ ``` +``` +DONE +Status: 3 NOTEs +``` ## exsic (1.1.1) Maintainer: Reinhard Simon @@ -377,7 +450,14 @@ __OK__ ## ez (4.2-2) Maintainer: Michael A. Lawrence -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` ## fbRanks (2.0) Maintainer: E Holmes @@ -548,6 +628,10 @@ team.name.select : : no visible global function definition team.name.select: no visible global function definition for ‘tkwait.window’ ``` +``` +DONE +Status: 2 NOTEs +``` ## fitbitScraper (0.1.2) Maintainer: Cory Nissen @@ -558,9 +642,10 @@ __OK__ Maintainer: Jose Gerardo Tamez-Pena ``` -checking whether package ‘FRESA.CAD’ can be installed ... ERROR +checking whether package ‘FRESA.CAD’ can be installed ... [28s/29s] ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/FRESA.CAD.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpIfPui2/check_cranab52a249f14/FRESA.CAD.Rcheck/00install.out’ for details. +Status: 1 ERROR ``` ## fslr (1.3) @@ -573,11 +658,38 @@ __OK__ Maintainer: Nikolai Gorte ``` -checking package dependencies ... ERROR -Packages required but not available: ‘osmar’ ‘frbs’ ‘rgdal’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. +checking R code for possible problems ... NOTE +create_drn: no visible global function definition for ‘getURL’ +create_drn: no visible global function definition for ‘xmlParse’ +err_region: no visible global function definition for ‘coordinates<-’ +err_region: no visible global function definition for ‘proj4string<-’ +err_region: no visible global function definition for ‘CRS’ +err_region: no visible global function definition for ‘spTransform’ +err_region: no visible global function definition for ‘coordinates’ +err_region: no visible global function definition for ‘Polygons’ +err_region: no visible global function definition for ‘Polygon’ +err_region: no visible global function definition for ‘SpatialPolygons’ +imp : : no visible global function definition for + ‘dist2Line’ +lines2segments: no visible global function definition for ‘coordinates’ +lines2segments: no visible global function definition for ‘Lines’ +lines2segments: no visible global function definition for ‘Line’ +lines2segments: no visible global function definition for + ‘SpatialLines’ +mm: no visible global function definition for ‘proj4string’ +mm: no visible global function definition for ‘spTransform’ +mm: no visible global function definition for ‘dist2Line’ +mm: no visible global function definition for ‘SpatialPointsDataFrame’ +smp1: no visible global function definition for ‘bearing’ +smp1: no visible global function definition for ‘spDists’ +smp2 : : no visible global function definition for + ‘dist2Line’ +smp2: no visible global function definition for ‘spDists’ +smp2 : : no visible global function definition for ‘spDists’ +``` +``` +DONE +Status: 1 NOTE ``` ## games (1.1.2) @@ -585,7 +697,7 @@ Maintainer: Brenton Kenkel __OK__ -## genderizeR (1.0.0) +## genderizeR (1.1.0) Maintainer: Kamil Wais Bug reports: https://github.com/kalimu/genderizeR @@ -593,16 +705,21 @@ Bug reports: https://github.com/kalimu/genderizeR checking Rd cross-references ... NOTE Package unavailable to check Rd xrefs: ‘sortinghat’ ``` +``` +DONE +Status: 1 NOTE +``` ## geotopbricks (1.3.6) Maintainer: Emanuele Cordano ``` -checking package dependencies ... ERROR -Package required but not available: ‘rgdal’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. +checking package dependencies ... NOTE +Package suggested but not available for checking: ‘soilwater’ +``` +``` +DONE +Status: 1 NOTE ``` ## gfcanalysis (1.2) @@ -610,17 +727,25 @@ Maintainer: Alex Zvoleff Bug reports: https://github.com/azvoleff/gfcanalysis/issues ``` -checking package dependencies ... ERROR -Packages required but not available: ‘rgdal’ ‘rasterVis’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE ``` ## GGally (0.5.0) Maintainer: Barret Schloerke -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` ## ggenealogy (0.1.0) Maintainer: Lindsay Rutter @@ -636,17 +761,38 @@ __OK__ ## ggsubplot (0.3.2) Maintainer: Garrett Grolemund -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` ## gsDesign (2.9-3) Maintainer: Keaven Anderson +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + plot.binomialSPRT plot.gsBinomialExact plot.gsDesign + plot.gsProbability plot.ssrCP print.eEvents print.gsBoundSummary + print.gsDesign print.gsProbability print.gsSurv print.nSurv + print.nSurvival summary.gsDesign summary.spendfn xtable.gsSurv +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` ``` checking line endings in Makefiles ... NOTE Found the following Makefile(s) without a final LF: inst/unitTests/Makefile Some ‘make’ programs ignore lines not ending in LF. ``` +``` +DONE +Status: 2 NOTEs +``` ## gsheet (0.1.0) Maintainer: Max Conway @@ -654,20 +800,19 @@ Bug reports: https://github.com/maxconway/gsheet/issues __OK__ -## GSIF (0.4-4) +## GSIF (0.4-5) Maintainer: Tomislav Hengl ``` checking package dependencies ... ERROR -Packages required but not available: - ‘RSAGA’ ‘dismo’ ‘rgdal’ ‘aqp’ ‘plotKML’ +Packages required but not available: ‘RSAGA’ ‘plotKML’ Packages suggested but not available for checking: - ‘soiltexture’ ‘spatstat’ ‘quantregForest’ ‘fossil’ ‘gdalUtils’ - ‘maxlike’ + ‘soiltexture’ ‘spatstat’ ‘SDMTools’ ‘spacetime’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## HistogramTools (0.3.1) @@ -687,13 +832,17 @@ checking dependencies in R code ... NOTE checking Rd cross-references ... NOTE Package unavailable to check Rd xrefs: ‘RProtoBuf’ ``` +``` +DONE +Status: 3 NOTEs +``` ## hoardeR (0.0-2) Maintainer: Daniel Fischer __OK__ -## htmlTable (1.2) +## htmlTable (1.3) Maintainer: Max Gordon Bug reports: https://github.com/gforge/htmlTable/issues @@ -702,82 +851,8 @@ checking Rd cross-references ... NOTE Package unavailable to check Rd xrefs: ‘pxweb’ ``` ``` -checking examples ... ERROR -Running examples in ‘htmlTable-Ex.R’ failed -The error most likely occurred in: - -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: htmlTable -> ### Title: Outputting HTML tables -> ### Aliases: htmlTable htmlTable.default knit_print.htmlTable -> ### print.htmlTable -> -> ### ** Examples -> -> # A simple output -> output <- matrix(1:4, -+ ncol=2, -+ dimnames = list(list("Row 1", "Row 2"), -+ list("Column 1", "Column 2"))) -> htmlTable(output) - - - - - - - - - - - - - - - - - - - - -
Column 1Column 2
Row 113
Row 224
> -> # An advanced output -> output <- -+ matrix(ncol=6, nrow=8) -> -> for (nr in 1:nrow(output)){ -+ for (nc in 1:ncol(output)){ -+ output[nr, nc] <- -+ paste0(nr, ":", nc) -+ } -+ } -> -> htmlTable(output, align="r", -+ header = paste(c("1st", "2nd", -+ "3rd", "4th", -+ "5th", "6th"), -+ "hdr"), -+ rnames = paste(c("1st", "2nd", -+ "3rd", -+ paste0(4:8, "th")), -+ "row"), -+ rgroup = paste("Group", LETTERS[1:3]), -+ n.rgroup = c(2,4,nrow(output) - 6), -+ cgroup = rbind(c("", "Column spanners", NA), -+ c("", "Cgroup 1", "Cgroup 2†")), -+ n.cgroup = rbind(c(1,2,NA), -+ c(2,2,2)), -+ caption="Basic table with both column spanners (groups) and row groups", -+ tfoot="† A table footer commment", -+ cspan.rgroup = 2, -+ col.columns = c(rep("none", 2), -+ rep("#F5FBFF", 4)), -+ col.rgroup = c("none", "#F7F7F7"), -+ css.cell = "padding-left: .5em; padding-right: .2em;") -Error in prGetStyle(cell_style) : - Invalid styles detected, one or more styles lack the needed style 'name: value': 'none' -Calls: htmlTable ... withVisible -> -> sprintf -> prGetStyle -Execution halted +DONE +Status: 1 NOTE ``` ## httr (0.6.1) @@ -788,11 +863,22 @@ checking dependencies in R code ... NOTE Namespace in Imports field not imported from: ‘R6’ All declared Imports should be used. ``` +``` +DONE +Status: 1 NOTE +``` ## indicoio (0.3) Maintainer: Madison May -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## io (0.2.2) Maintainer: David J. H. Shih @@ -802,6 +888,10 @@ Bug reports: https://bitbucket.org/djhshih/io/issues checking package dependencies ... NOTE Package suggested but not available for checking: ‘rhdf5’ ``` +``` +DONE +Status: 1 NOTE +``` ## ISOweek (0.6-2) Maintainer: Uwe Block @@ -810,8 +900,12 @@ Maintainer: Uwe Block checking Rd cross-references ... NOTE Package unavailable to check Rd xrefs: ‘surveillance’ ``` +``` +DONE +Status: 1 NOTE +``` -## knitr (1.9) +## knitr (1.10) Maintainer: Yihui Xie Bug reports: https://github.com/yihui/knitr/issues @@ -831,26 +925,16 @@ There are ::: calls to the package's namespace in its code. A package almost never needs to use ::: for its own objects: ‘.KoNLPEnv’ ``` +``` +DONE +Status: 1 NOTE +``` -## LindenmayeR (0.1-0) +## LindenmayeR (0.1.4) Maintainer: Bryan Hanson Bug reports: https://github.com/bryanhanson/LindenmayeR/issues -``` -checking dependencies in R code ... NOTE -Package in Depends field not imported from: ‘grid’ - These packages need to be imported from (in the NAMESPACE file) - for when this namespace is loaded but not attached. -``` -``` -checking R code for possible problems ... NOTE -drawLsys: no visible global function definition for ‘grid.newpage’ -drawLsys: no visible global function definition for ‘viewport’ -drawLsys: no visible global function definition for ‘pushViewport’ -drawLsys: no visible global function definition for ‘grid.rect’ -drawLsys: no visible global function definition for ‘grid.move.to’ -drawLsys: no visible global function definition for ‘grid.line.to’ -``` +__OK__ ## lint (0.3) Maintainer: Andrew Redd @@ -861,6 +945,10 @@ autotest_style: no visible global function definition for ‘test_that’ test_style: no visible global function definition for ‘expect_equivalent’ ``` +``` +DONE +Status: 1 NOTE +``` ## lubridate (1.3.3) Maintainer: Garrett Grolemund @@ -870,13 +958,32 @@ Bug reports: https://github.com/hadley/lubridate/issues checking package dependencies ... NOTE Packages which this enhances but not available for checking: ‘its’ ‘fts’ ``` +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + pretty.day pretty.hour pretty.min pretty.month pretty.point + pretty.sec pretty.unit pretty.year +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` +``` +DONE +Status: 2 NOTEs +``` ## mailR (0.4.1) Maintainer: Rahul Premraj -__OK__ +``` +checking package dependencies ... ERROR +Package required but not available: ‘R.utils’ + +See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ +manual. +Status: 1 ERROR +``` -## managelocalrepo (0.1.4) +## managelocalrepo (0.1.5) Maintainer: Imanuel Costigan __OK__ @@ -915,23 +1022,35 @@ toLatex.marssMODEL: no visible global function definition for ‘sys’ toLatex.marssMODEL: no visible global function definition for ‘str_replace’ ``` +``` +DONE +Status: 2 NOTEs +``` ## MazamaSpatialUtils (0.2.3) Maintainer: Jonathan Callahan ``` -checking package dependencies ... ERROR -Package required but not available: ‘rgdal’ - -Package suggested but not available for checking: ‘ISOcodes’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. +checking whether package ‘MazamaSpatialUtils’ can be installed ... WARNING +Found the following significant warnings: + Warning: replacing previous import by ‘stringr::%>%’ when loading ‘MazamaSpatialUtils’ +See ‘/private/tmp/RtmpIfPui2/check_cranab52a249f14/MazamaSpatialUtils.Rcheck/00install.out’ for details. +``` +``` +DONE +Status: 1 WARNING ``` ## mpoly (0.0.5) Maintainer: David Kahle +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + +.mpoly +.mpolyList -.mpoly -.mpolyList deriv.mpoly +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` ``` checking examples ... ERROR Running examples in ‘mpoly-Ex.R’ failed @@ -1082,6 +1201,10 @@ Error in while (str_detect(fLP, "--")) { : Calls: mp ... lapply -> FUN -> Reduce -> lapply -> as.list -> bubble Execution halted ``` +``` +DONE +Status: 1 ERROR, 1 NOTE +``` ## mtk (1.0) Maintainer: Juhui WANG @@ -1100,26 +1223,58 @@ plmm.mtk: no visible global function definition for ‘stepAIC’ checking data for non-ASCII characters ... NOTE Note: found 2 marked UTF-8 strings ``` +``` +DONE +Status: 3 NOTEs +``` ## networkreporting (0.0.1) Maintainer: Dennis Feehan -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` ## neuroim (0.0.3) Maintainer: Bradley Buchsbaum -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` ## ngramr (1.4.5) Maintainer: Sean Carmody -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## nlWaldTest (1.0.1) Maintainer: Oleh Komashko -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## NMF (0.20.5) Maintainer: Renaud Gaujoux @@ -1151,7 +1306,7 @@ test.match_atrack : .check: no visible global function definition for ``` ``` checking Rd cross-references ... NOTE -Packages unavailable to check Rd xrefs: ‘Biobase’, ‘RcppOctave’ +Packages unavailable to check Rd xrefs: ‘RcppOctave’, ‘Biobase’ ``` ``` checking data for non-ASCII characters ... NOTE @@ -1177,7 +1332,7 @@ The error most likely occurred in: > ## Don't show: > # roxygen generated flag > options(R_CHECK_RUNNING_EXAMPLES_=TRUE) -> ## End Don't show +> ## End(Don't show) > > # generate a synthetic dataset with known classes > n <- 50; counts <- c(5, 5, 8); @@ -1192,11 +1347,32 @@ Error in process_tracks(x, tracks, annRow, annCol) : Calls: basismap -> basismap -> .local -> process_tracks Execution halted ``` +``` +checking re-building of vignette outputs ... NOTE +Error in re-building vignettes: + ... +Quitting from lines 385-398 (NMF-vignette.Rnw) +Error: processing vignette 'NMF-vignette.Rnw' failed with diagnostics: +unable to find required package 'Biobase' +Execution halted + +``` +``` +DONE +Status: 1 ERROR, 6 NOTEs +``` ## OpenRepGrid (0.1.9) Maintainer: Mark Heckmann -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## optiRum (0.35) Maintainer: Stephanie Locke @@ -1208,6 +1384,10 @@ __OK__ Maintainer: Trevor L Davis Bug reports: https://github.com/trevorld/optparse/issues +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` ``` checking re-building of vignette outputs ... NOTE Error in re-building vignettes: @@ -1217,6 +1397,10 @@ Error: processing vignette 'optparse.Rrst' failed with diagnostics: conversion by rst2pdf failed! Execution halted +``` +``` +DONE +Status: 2 NOTEs ``` ## orgR (0.9.0) @@ -1236,6 +1420,10 @@ Packages suggested but not available for checking: checking data for non-ASCII characters ... NOTE Note: found 490 marked UTF-8 strings ``` +``` +DONE +Status: 2 NOTEs +``` ## patchSynctex (0.1-0) Maintainer: Emmanuel Charpentier @@ -1245,6 +1433,10 @@ __OK__ ## pathological (0.0-3) Maintainer: Richard Cotton +``` +checking Rd cross-references ... NOTE +Package unavailable to check Rd xrefs: ‘R.utils’ +``` ``` checking examples ... ERROR Running examples in ‘pathological-Ex.R’ failed @@ -1277,6 +1469,28 @@ Error in stri_match_first_regex(string, pattern, opts_regex = attr(pattern, : Calls: decompose_path -> str_match -> stri_match_first_regex -> .Call Execution halted ``` +``` +checking tests ... ERROR +Running the tests in ‘tests/run-all.R’ failed. +Last 13 lines of output: + 4: expect_equal(strip_extension(x), expected$na) at test_strip_extension.R:107 + 5: expect_that(object, equals(expected, label = expected.label, ...), info = info, label = label) + 6: condition(object) + 7: compare(expected, actual, ...) + 8: compare.character(expected, actual, ...) + 9: identical(x, y) + 10: strip_extension(x) + 11: decompose_path(x[ok]) + 12: str_match(basename_x[not_missing_and_has_extension], rx) + 13: stri_match_first_regex(string, pattern, opts_regex = attr(pattern, "options")) at /Users/hadley/Documents/stringr/stringr/R/match.r:37 + + Error: Test failures + Execution halted +``` +``` +DONE +Status: 2 ERRORs, 1 NOTE +``` ## PepPrep (1.1.0) Maintainer: Rafael Dellen @@ -1287,6 +1501,7 @@ Package required but not available: ‘biomaRt’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## pkgmaker (0.22) @@ -1335,20 +1550,24 @@ write_PACKAGES_index: no visible global function definition for write_PACKAGES_index: no visible global function definition for ‘finish’ ``` +``` +DONE +Status: 3 NOTEs +``` -## plotKML (0.5-0) +## plotKML (0.5-1) Maintainer: Tomislav Hengl ``` checking package dependencies ... ERROR -Packages required but not available: - ‘rgdal’ ‘dismo’ ‘aqp’ ‘colorRamps’ ‘RSAGA’ +Packages required but not available: ‘spacetime’ ‘RSAGA’ Packages suggested but not available for checking: - ‘adehabitat’ ‘fossil’ ‘spcosa’ ‘spatstat’ ‘rgbif’ ‘GSIF’ ‘gdalUtils’ + ‘spcosa’ ‘spatstat’ ‘GSIF’ ‘uuid’ ‘snowfall’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## plotROC (1.3.3) @@ -1372,6 +1591,10 @@ checking R code for possible problems ... NOTE plot.preplot.polywog: no visible global function definition for ‘persp3d’ ``` +``` +DONE +Status: 2 NOTEs +``` ## primerTree (1.0.1) Maintainer: Jim Hester @@ -1399,6 +1622,10 @@ ggplot.profr: no visible global function definition for ggplot.profr: no visible global function definition for ‘scale_x_continuous’ ``` +``` +DONE +Status: 2 NOTEs +``` ## ProjectTemplate (0.6) Maintainer: Kirill Mueller @@ -1408,6 +1635,14 @@ Bug reports: https://github.com/johnmyleswhite/ProjectTemplate/issues checking package dependencies ... NOTE Packages suggested but not available for checking: ‘RODBC’ ‘RPostgreSQL’ ``` +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 2 NOTEs +``` ## pryr (0.1) Maintainer: Hadley Wickham @@ -1418,11 +1653,25 @@ __OK__ ## PubMedWordcloud (0.3.2) Maintainer: Felix Yanhui Fan -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## pxR (0.40.0) Maintainer: Carlos J. Gil Bellosta +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + as.px.array +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` ``` checking R code for possible problems ... NOTE read.px : get.attributes: no visible global function definition for @@ -1431,6 +1680,10 @@ read.px: no visible global function definition for ‘str_locate_all’ read.px: no visible global function definition for ‘str_sub’ read.px: no visible global function definition for ‘str_length’ ``` +``` +DONE +Status: 2 NOTEs +``` ## pxweb (0.5.5) Maintainer: Mans Magnusson @@ -1441,7 +1694,21 @@ __OK__ ## QCAtools (0.1) Maintainer: Jirka Lewandowski -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + plot.qca +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` +``` +DONE +Status: 2 NOTEs +``` ## quipu (1.9.0) Maintainer: Reinhard Simon @@ -1454,8 +1721,8 @@ Maintainer: Graham Williams ``` checking package dependencies ... NOTE Packages suggested but not available for checking: - ‘RGtk2’ ‘cairoDevice’ ‘graph’ ‘gWidgetsRGtk2’ ‘playwith’ ‘RBGL’ - ‘rggobi’ ‘RGtk2Extras’ ‘RODBC’ ‘pkgDepTools’ ‘Rgraphviz’ + ‘RGtk2’ ‘graph’ ‘gWidgetsRGtk2’ ‘playwith’ ‘RBGL’ ‘rggobi’ + ‘RGtk2Extras’ ‘RODBC’ ‘pkgDepTools’ ‘Rgraphviz’ ``` ``` checking installed package size ... NOTE @@ -1467,6 +1734,11 @@ checking installed package size ... NOTE ``` ``` checking dependencies in R code ... NOTE +Error in dyn.load(file, DLLpath = DLLpath, ...) : + unable to load shared object '/Users/hadley/R-revdep/cairoDevice/libs/cairoDevice.so': + dlopen(/Users/hadley/R-revdep/cairoDevice/libs/cairoDevice.so, 6): Library not loaded: /usr/local/lib/libpng15.15.dylib + Referenced from: /usr/local/lib/libcairo.2.dylib + Reason: image not found 'library' or 'require' calls in package code: ‘Hmisc’ ‘RBGL’ ‘RGtk2’ ‘RGtk2Extras’ ‘ROCR’ ‘RODBC’ ‘Rgraphviz’ ‘XML’ ‘ada’ ‘arules’ ‘bitops’ ‘cairoDevice’ ‘colorspace’ ‘e1071’ ‘fBasics’ @@ -1477,6 +1749,13 @@ checking dependencies in R code ... NOTE See section 'Suggested packages' in the 'Writing R Extensions' manual. ``` ``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + predict.hclust predict.kmeans print.summary.nnet +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` +``` checking R code for possible problems ... NOTE Found an obsolete/platform-specific call in the following functions: ‘openMyDevice’ ‘printPlot’ ‘savePlotToFile’ @@ -1485,18 +1764,16 @@ Found the platform-specific devices: dev.new() is the preferred way to open a new device, in the unlikely event one is needed. ``` +``` +DONE +Status: 5 NOTEs +``` ## rAvis (0.1.2) Maintainer: Sara Varela Bug reports: https://github.com/ropensci/rAvis/issues -``` -checking package dependencies ... ERROR -Package required but not available: ‘rgdal’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -``` +__OK__ ## RbioRXN (1.5) Maintainer: Byoungnam Min @@ -1507,12 +1784,20 @@ Packages required but not available: ‘fmcsR’ ‘ChemmineR’ ‘KEGGREST’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## rClinicalCodes (1.0.1) Maintainer: David Springate -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## RcppOctave (0.14.5) Maintainer: Renaud Gaujoux @@ -1521,14 +1806,23 @@ Bug reports: http://github.com/renozao/RcppOctave/issues ``` checking whether package ‘RcppOctave’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/RcppOctave.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpIfPui2/check_cranab52a249f14/RcppOctave.Rcheck/00install.out’ for details. +Status: 1 ERROR ``` ## rdryad (0.1.1) Maintainer: Scott Chamberlain Bug reports: https://github.com/ropensci/rdryad/issues -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## redcapAPI (1.3) Maintainer: Stephen Lane @@ -1568,6 +1862,10 @@ Last 13 lines of output: Error: Test failures Execution halted ``` +``` +DONE +Status: 1 ERROR, 2 NOTEs +``` ## RefManageR (0.8.45) Maintainer: Mathew W. McLean @@ -1579,6 +1877,10 @@ Foreign function call to a different package: See chapter ‘System and foreign language interfaces’ in the ‘Writing R Extensions’ manual. ``` +``` +DONE +Status: 1 NOTE +``` ## reportRx (1.0) Maintainer: Ryan Del Bel @@ -1589,9 +1891,22 @@ __OK__ Maintainer: Hadley Wickham Bug reports: https://github.com/hadley/reshape/issues +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` + +## rex (1.0.1) +Maintainer: Jim Hester +Bug reports: https://github.com/kevinushey/rex/issues + __OK__ -## rfordummies (0.0-2) +## rfordummies (0.1.1) Maintainer: Andrie de Vries Bug reports: https://github.com/andrie/rfordummies/issues @@ -1611,11 +1926,30 @@ __OK__ ## rio (0.1.2) Maintainer: Chung-hong Chan +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` + +## RJafroc (0.0.1) +Maintainer: Xuetong Zhai + __OK__ ## rlme (0.4) Maintainer: Yusuf Bilgic +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + plot.rlme summary.rlme +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` ``` checking examples ... ERROR Running examples in ‘rlme-Ex.R’ failed @@ -1643,6 +1977,28 @@ Error in stri_extract_all_regex(string, pattern, simplify = simplify, : Calls: rlme -> str_extract_all -> stri_extract_all_regex -> .Call Execution halted ``` +``` +checking tests ... ERROR +Running the tests in ‘tests/test-all.R’ failed. +Last 13 lines of output: + + Type 'demo()' for some demos, 'help()' for on-line help, or + 'help.start()' for an HTML browser interface to help. + Type 'q()' to quit R. + + > library(testthat) + > + > test_check("rlme") + Loading required package: rlme + GEER method : Error in stri_extract_all_regex(string, pattern, simplify = simplify, : + Incorrectly nested parentheses in regexp pattern. (U_REGEX_MISMATCHED_PAREN) + Calls: test_check ... rlme -> str_extract_all -> stri_extract_all_regex -> .Call + Execution halted +``` +``` +DONE +Status: 2 ERRORs, 1 NOTE +``` ## rngtools (1.2.4) Maintainer: Renaud Gaujoux @@ -1662,18 +2018,16 @@ RNGseq: no visible global function definition for ‘nextRNGStream’ RNGseq_seed: no visible global function definition for ‘nextRNGStream’ checkRNG: no visible global function definition for ‘checkTrue’ ``` +``` +DONE +Status: 2 NOTEs +``` ## rnoaa (0.3.3) Maintainer: Scott Chamberlain Bug reports: http://www.github.com/ropensci/rnoaa/issues -``` -checking package dependencies ... ERROR -Package required but not available: ‘rgdal’ - -See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ -manual. -``` +__OK__ ## rNOMADS (2.1.3) Maintainer: Daniel C. Bowman @@ -1685,13 +2039,14 @@ Maintainer: Claudia Vitolo ``` checking package dependencies ... ERROR -Package required but not available: ‘rgdal’ +Package required but not available: ‘XML2R’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` -## roxygen2 (4.1.0) +## roxygen2 (4.1.1) Maintainer: Hadley Wickham __OK__ @@ -1700,15 +2055,21 @@ __OK__ Maintainer: Kun Ren Bug reports: https://github.com/renkun-ken/rprintf/issues -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## rsgcc (1.0.6) Maintainer: Chuang Ma ``` checking package dependencies ... ERROR -Packages required but not available: - ‘biwt’ ‘cairoDevice’ ‘gWidgetsRGtk2’ ‘minerva’ ‘parmigene’ +Packages required but not available: ‘gWidgetsRGtk2’ ‘snowfall’ Package suggested but not available for checking: ‘ctc’ @@ -1720,12 +2081,17 @@ selectively is preferable. See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## RSiteCatalyst (1.4.3) Maintainer: Randy Zwitch Bug reports: https://github.com/randyzwitch/RSiteCatalyst +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` ``` checking tests ... ERROR Running the tests in ‘tests/testthat.R’ failed. @@ -1744,6 +2110,10 @@ Last 13 lines of output: In addition: There were 50 or more warnings (use warnings() to see the first 50) Execution halted ``` +``` +DONE +Status: 1 ERROR, 1 NOTE +``` ## rsnps (0.1.6) Maintainer: Scott Chamberlain @@ -1759,6 +2129,15 @@ Bug reports: https://github.com/ropengov/rsunlight/issues checking package dependencies ... NOTE Package suggested but not available for checking: ‘rCharts’ ``` +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 2 NOTEs +``` ## rUnemploymentData (1.0.0) Maintainer: Ari Lamstein @@ -1769,6 +2148,10 @@ __OK__ ## ryouready (0.3) Maintainer: Mark Heckmann +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` ``` checking dependencies in R code ... NOTE Packages in Depends field not imported from: @@ -1785,21 +2168,31 @@ intervals: no visible global function definition for ‘str_replace_all’ intervals: no visible global function definition for ‘str_detect’ intervals: no visible global function definition for ‘str_replace’ ``` +``` +DONE +Status: 3 NOTEs +``` ## scholar (0.1.2) Maintainer: James Keirstead -__OK__ +``` +checking whether package ‘scholar’ can be installed ... ERROR +Installation failed. +See ‘/private/tmp/RtmpIfPui2/check_cranab52a249f14/scholar.Rcheck/00install.out’ for details. +Status: 1 ERROR +``` ## sdcTable (0.18.0) Maintainer: Bernhard Meindl ``` checking package dependencies ... ERROR -Packages required but not available: ‘Rglpk’ ‘lpSolveAPI’ +Package required but not available: ‘Rglpk’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## selectr (0.2-3) @@ -1811,7 +2204,14 @@ __OK__ ## seqminer (3.4) Maintainer: Xiaowei Zhan -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## simPH (1.3) Maintainer: Christopher Gandrud @@ -1825,15 +2225,21 @@ Maintainer: Roger Marshall ``` checking whether package ‘spanr’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/spanr.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpIfPui2/check_cranab52a249f14/spanr.Rcheck/00install.out’ for details. +Status: 1 ERROR ``` ## spatsurv (0.9-8) Maintainer: Benjamin M. Taylor ``` -checking package dependencies ... NOTE -Package suggested but not available for checking: ‘rgdal’ +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE ``` ## sqliter (0.1.0) @@ -1851,12 +2257,20 @@ Packages which this enhances but not available for checking: ‘RPostgreSQL’ ‘RODBC’ ``` ``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` checking dependencies in R code ... NOTE 'library' or 'require' calls in package code: ‘RJDBC’ ‘RMySQL’ ‘RODBC’ ‘RPostgreSQL’ ‘RSQLite’ ‘tcltk’ Please use :: or requireNamespace() instead. See section 'Suggested packages' in the 'Writing R Extensions' manual. ``` +``` +DONE +Status: 3 NOTEs +``` ## srd (1.0) Maintainer: Roger Marshall @@ -1864,13 +2278,21 @@ Maintainer: Roger Marshall ``` checking whether package ‘srd’ can be installed ... ERROR Installation failed. -See ‘/private/tmp/RtmpPgHCED/check_cran46f2570a2e67/srd.Rcheck/00install.out’ for details. +See ‘/private/tmp/RtmpIfPui2/check_cranab52a249f14/srd.Rcheck/00install.out’ for details. +Status: 1 ERROR ``` ## ssh.utils (1.0) Maintainer: Sergei Izrailev -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` ## Stack (2.0-1) Maintainer: Mike Malecki @@ -1890,6 +2312,10 @@ Maintainer: Brandon Stewart checking dependencies in R code ... NOTE Missing or unexported object: ‘tm::meta’ ``` +``` +DONE +Status: 1 NOTE +``` ## surveydata (0.1-14) Maintainer: Andrie de Vries @@ -1899,11 +2325,22 @@ __OK__ ## swirl (2.2.21) Maintainer: Nick Carchedi -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` +``` +DONE +Status: 1 NOTE +``` ## taRifx (1.0.6) Maintainer: Ari B. Friedman +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` ``` checking dependencies in R code ... NOTE 'library' or 'require' calls in package code: @@ -1912,6 +2349,13 @@ checking dependencies in R code ... NOTE See section 'Suggested packages' in the 'Writing R Extensions' manual. ``` ``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + as.matrix.by stack.list +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` +``` checking R code for possible problems ... NOTE autoplot.microbenchmark: no visible global function definition for ‘ggplot’ @@ -1981,6 +2425,10 @@ xtable.summary.lme: no visible global function definition for ‘display<-’ xtablelm: no visible global function definition for ‘xtable’ ``` +``` +DONE +Status: 4 NOTEs +``` ## taxize (0.5.2) Maintainer: Scott Chamberlain @@ -1997,6 +2445,7 @@ Package required but not available: ‘multtest’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## tikzDevice (0.8.1) @@ -2009,6 +2458,10 @@ __OK__ Maintainer: Bernd Bischl Bug reports: https://github.com/berndbischl/tspmeta/issues +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Title field: should not end in a period. +``` ``` checking S3 generic/method consistency ... WARNING tour_length: @@ -2018,6 +2471,15 @@ tour_length.tsp_instance: See section ‘Generic functions and methods’ in the ‘Writing R Extensions’ manual. + +Found the following apparent S3 methods exported but not registered: + autoplot.tsp_instance +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` +``` +DONE +Status: 1 WARNING, 1 NOTE ``` ## tumblR (1.1) @@ -2050,7 +2512,20 @@ __OK__ ## wikipediatrend (0.2.0) Maintainer: Peter Meissner -__OK__ +``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + wp_date.POSIXct wp_date.POSIXlt wp_date.character wp_date.date + wp_date.dates wp_date.default wp_date.factor wp_date.numeric + wp_day.POSIXlt wp_day.default wp_month.POSIXlt wp_month.default + wp_wday.POSIXlt wp_wday.default wp_year.POSIXlt wp_year.default +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` +``` +DONE +Status: 1 NOTE +``` ## wsrf (1.4.0) Maintainer: He Zhao @@ -2062,6 +2537,13 @@ Package in Depends field not imported from: ‘parallel’ for when this namespace is loaded but not attached. ``` ``` +checking S3 generic/method consistency ... NOTE +Found the following apparent S3 methods exported but not registered: + correlation.wsrf predict.wsrf print.wsrf strength.wsrf summary.wsrf +See section ‘Registering S3 methods’ in the ‘Writing R Extensions’ +manual. +``` +``` checking R code for possible problems ... NOTE .clwsrf: no visible global function definition for ‘makeCluster’ .clwsrf: no visible global function definition for ‘clusterEvalQ’ @@ -2089,16 +2571,21 @@ write to stdout/stderr instead of to the console, nor the system RNG. See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual. ``` +``` +DONE +Status: 4 NOTEs +``` ## wux (2.0-0) Maintainer: Thomas Mendlik ``` checking package dependencies ... ERROR -Packages required but not available: ‘ncdf’ ‘rgdal’ +Package required but not available: ‘rworldmap’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## x.ent (1.1.2) @@ -2110,17 +2597,25 @@ __OK__ ## x12 (1.6.0) Maintainer: Alexander Kowarik -__OK__ +``` +checking DESCRIPTION meta-information ... NOTE +Malformed Description field: should contain one or more complete sentences. +``` +``` +DONE +Status: 1 NOTE +``` ## x12GUI (0.13.0) Maintainer: Alexander Kowarik ``` checking package dependencies ... ERROR -Packages required but not available: ‘x12’ ‘RGtk2’ ‘cairoDevice’ +Packages required but not available: ‘x12’ ‘RGtk2’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. +Status: 1 ERROR ``` ## yhatr (0.13.4) From d66b875e288d0ae2ed88ee86a01c6042ebe1458b Mon Sep 17 00:00:00 2001 From: hadley Date: Tue, 28 Apr 2015 16:31:32 -0500 Subject: [PATCH 09/44] NO TRAILING PERIOD --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index c0dc8b7d..de074bfc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: stringr Version: 1.0.0 -Title: Simple, Consistent Wrappers for Common String Operations. +Title: Simple, Consistent Wrappers for Common String Operations Description: A consistent, simple and easy to use set of wrappers around the fantastic stringi package. All function and argument names (and positions) are consistent, all functions deal with NA's and zero length vectors From 9fe246601cee0565293739ee3a52d9998cf359bd Mon Sep 17 00:00:00 2001 From: hadley Date: Wed, 29 Apr 2015 07:42:53 -0500 Subject: [PATCH 10/44] Note about maintainer change. Description fixes --- DESCRIPTION | 4 ++-- cran-comments.md | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index de074bfc..6274ec21 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,8 +2,8 @@ Package: stringr Version: 1.0.0 Title: Simple, Consistent Wrappers for Common String Operations Description: A consistent, simple and easy to use set of wrappers around the - fantastic stringi package. All function and argument names (and positions) - are consistent, all functions deal with NA's and zero length vectors + fantastic 'stringi' package. All function and argument names (and positions) + are consistent, all functions deal with "NA"'s and zero length vectors in the same way, and the output from one function is easy to feed into the input of another. Authors@R: as.person(c( diff --git a/cran-comments.md b/cran-comments.md index fe87ede0..afe95aeb 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -4,7 +4,10 @@ * win-builder (devel and release) ## R CMD check results -There were no ERRORs, WARNINGs or NOTEs. +There were no ERRORs, or WARNINGs. + +There was one note: I am changing the maintainer email to my rstudio address, +and will send confirmation shortly. ## Downstream dependencies This release changes the backend of stringr from R's built in regular From b62f09ed26a5afa311280ff7bee393d5f1881a21 Mon Sep 17 00:00:00 2001 From: hadley Date: Wed, 29 Apr 2015 07:44:26 -0500 Subject: [PATCH 11/44] Use person(), not as.person() --- DESCRIPTION | 8 ++++---- cran-comments.md | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6274ec21..94f28a7c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,10 +6,10 @@ Description: A consistent, simple and easy to use set of wrappers around the are consistent, all functions deal with "NA"'s and zero length vectors in the same way, and the output from one function is easy to feed into the input of another. -Authors@R: as.person(c( - "Hadley Wickham [aut, cre, cph]", - "RStudio [cph]" - )) +Authors@R: c( + person("Hadley", "Wickham", , "hadley@rstudio.com", c("aut", "cre", "cph")), + person("RStudio", role = "cph") + ) License: GPL-2 Depends: R (>= 2.14) diff --git a/cran-comments.md b/cran-comments.md index afe95aeb..c0f47fed 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,7 @@ +This is a resubmission. I've now correctly used person() in the Authors@R field. + +--- + ## Test environments * local OS X install, R 3.2.0 * ubuntu 12.04 (on travis-ci), R 3.2.0 From 8ce49e8db7e1018f47fc2ee3174b20576cf12cd9 Mon Sep 17 00:00:00 2001 From: hadley Date: Thu, 30 Apr 2015 08:17:58 -0500 Subject: [PATCH 12/44] Bump version --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 94f28a7c..93a9f0a0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: stringr -Version: 1.0.0 +Version: 1.0.0.9000 Title: Simple, Consistent Wrappers for Common String Operations Description: A consistent, simple and easy to use set of wrappers around the fantastic 'stringi' package. All function and argument names (and positions) diff --git a/NEWS.md b/NEWS.md index 7979682a..a8b5eb2a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# stringr 1.0.0.9000 + # stringr 1.0.0 * stringr is now powered by [stringi](https://github.com/Rexamine/stringi) From 05612e7db80ff480adedf01996e1378f83b34d8f Mon Sep 17 00:00:00 2001 From: hadley Date: Mon, 4 May 2015 09:01:38 -0500 Subject: [PATCH 13/44] Upgrade roxygen2 --- NAMESPACE | 2 +- man/case.Rd | 2 +- man/invert_match.Rd | 2 +- man/modifier-deprecated.Rd | 2 +- man/modifiers.Rd | 2 +- man/pipe.Rd | 2 +- man/str_c.Rd | 2 +- man/str_conv.Rd | 2 +- man/str_count.Rd | 2 +- man/str_detect.Rd | 2 +- man/str_dup.Rd | 2 +- man/str_extract.Rd | 2 +- man/str_length.Rd | 2 +- man/str_locate.Rd | 2 +- man/str_match.Rd | 9 ++++++++- man/str_order.Rd | 2 +- man/str_pad.Rd | 2 +- man/str_replace.Rd | 2 +- man/str_replace_na.Rd | 2 +- man/str_split.Rd | 2 +- man/str_sub.Rd | 2 +- man/str_subset.Rd | 2 +- man/str_trim.Rd | 2 +- man/str_wrap.Rd | 2 +- man/stringr.Rd | 2 +- man/word.Rd | 2 +- 26 files changed, 33 insertions(+), 26 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index c70f329a..4a7e8f9f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2 (4.1.0): do not edit by hand +# Generated by roxygen2 (4.1.1): do not edit by hand export("%>%") export("str_sub<-") diff --git a/man/case.Rd b/man/case.Rd index 92d56bed..c5dbb117 100644 --- a/man/case.Rd +++ b/man/case.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/case.R \name{case} \alias{case} diff --git a/man/invert_match.Rd b/man/invert_match.Rd index 92619f8b..b705ba0a 100644 --- a/man/invert_match.Rd +++ b/man/invert_match.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/locate.r \name{invert_match} \alias{invert_match} diff --git a/man/modifier-deprecated.Rd b/man/modifier-deprecated.Rd index 490d18e5..ce662f69 100644 --- a/man/modifier-deprecated.Rd +++ b/man/modifier-deprecated.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/modifiers.r \name{modifier-deprecated} \alias{ignore.case} diff --git a/man/modifiers.Rd b/man/modifiers.Rd index caeb126c..11d5a555 100644 --- a/man/modifiers.Rd +++ b/man/modifiers.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/modifiers.r \name{modifiers} \alias{boundary} diff --git a/man/pipe.Rd b/man/pipe.Rd index 08a8b061..860620e6 100644 --- a/man/pipe.Rd +++ b/man/pipe.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/utils.R \name{\%>\%} \alias{\%>\%} diff --git a/man/str_c.Rd b/man/str_c.Rd index bf60e137..0b2b2e41 100644 --- a/man/str_c.Rd +++ b/man/str_c.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/c.r \name{str_c} \alias{str_c} diff --git a/man/str_conv.Rd b/man/str_conv.Rd index 252d4528..68b574fa 100644 --- a/man/str_conv.Rd +++ b/man/str_conv.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/conv.R \name{str_conv} \alias{str_conv} diff --git a/man/str_count.Rd b/man/str_count.Rd index 38cb61bd..138569de 100644 --- a/man/str_count.Rd +++ b/man/str_count.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/count.r \name{str_count} \alias{str_count} diff --git a/man/str_detect.Rd b/man/str_detect.Rd index afdad9b6..8d9f9562 100644 --- a/man/str_detect.Rd +++ b/man/str_detect.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/detect.r \name{str_detect} \alias{str_detect} diff --git a/man/str_dup.Rd b/man/str_dup.Rd index 1d6b1c9d..c07e3d16 100644 --- a/man/str_dup.Rd +++ b/man/str_dup.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/dup.r \name{str_dup} \alias{str_dup} diff --git a/man/str_extract.Rd b/man/str_extract.Rd index 6b358654..32d96d9d 100644 --- a/man/str_extract.Rd +++ b/man/str_extract.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/extract.r \name{str_extract} \alias{str_extract} diff --git a/man/str_length.Rd b/man/str_length.Rd index 920c5934..e4b04f03 100644 --- a/man/str_length.Rd +++ b/man/str_length.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/length.r \name{str_length} \alias{str_length} diff --git a/man/str_locate.Rd b/man/str_locate.Rd index 040809f8..e68c5745 100644 --- a/man/str_locate.Rd +++ b/man/str_locate.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/locate.r \name{str_locate} \alias{str_locate} diff --git a/man/str_match.Rd b/man/str_match.Rd index d332d51e..a3f16c74 100644 --- a/man/str_match.Rd +++ b/man/str_match.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/match.r \name{str_match} \alias{str_match} @@ -37,6 +37,13 @@ str_match(strings, phone) # Extract/match all str_extract_all(strings, phone) str_match_all(strings, phone) + +x <- c("
", " <>", "", "", NA) +str_match(x, "<(.*?)> <(.*?)>") +str_match_all(x, "<(.*?)>") + +str_extract(x, "<.*?>") +str_extract_all(x, "<.*?>") } \seealso{ \code{\link{str_extract}} to extract the complete match, diff --git a/man/str_order.Rd b/man/str_order.Rd index 90f37720..64150843 100644 --- a/man/str_order.Rd +++ b/man/str_order.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/sort.R \name{str_order} \alias{str_order} diff --git a/man/str_pad.Rd b/man/str_pad.Rd index 5ef80287..3af12fb2 100644 --- a/man/str_pad.Rd +++ b/man/str_pad.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/pad-trim.r \name{str_pad} \alias{str_pad} diff --git a/man/str_replace.Rd b/man/str_replace.Rd index 6359c890..813b07eb 100644 --- a/man/str_replace.Rd +++ b/man/str_replace.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/replace.r \name{str_replace} \alias{str_replace} diff --git a/man/str_replace_na.Rd b/man/str_replace_na.Rd index 37e58cd2..c38248f0 100644 --- a/man/str_replace_na.Rd +++ b/man/str_replace_na.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/replace.r \name{str_replace_na} \alias{str_replace_na} diff --git a/man/str_split.Rd b/man/str_split.Rd index 84cc7075..a66ae2ed 100644 --- a/man/str_split.Rd +++ b/man/str_split.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/split.r \name{str_split} \alias{str_split} diff --git a/man/str_sub.Rd b/man/str_sub.Rd index 597e2389..73d70740 100644 --- a/man/str_sub.Rd +++ b/man/str_sub.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/sub.r \name{str_sub} \alias{str_sub} diff --git a/man/str_subset.Rd b/man/str_subset.Rd index 91778ac3..94a4ee13 100644 --- a/man/str_subset.Rd +++ b/man/str_subset.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/subset.R \name{str_subset} \alias{str_subset} diff --git a/man/str_trim.Rd b/man/str_trim.Rd index aa292893..6f15123a 100644 --- a/man/str_trim.Rd +++ b/man/str_trim.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/pad-trim.r \name{str_trim} \alias{str_trim} diff --git a/man/str_wrap.Rd b/man/str_wrap.Rd index c2a68b37..228419f6 100644 --- a/man/str_wrap.Rd +++ b/man/str_wrap.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/wrap.r \name{str_wrap} \alias{str_wrap} diff --git a/man/stringr.Rd b/man/stringr.Rd index a49955dd..28f8280a 100644 --- a/man/stringr.Rd +++ b/man/stringr.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/stringr.R \name{stringr} \alias{stringr} diff --git a/man/word.Rd b/man/word.Rd index 02642e83..cb444146 100644 --- a/man/word.Rd +++ b/man/word.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/word.r \name{word} \alias{word} From e6cb994dcc84c067233ee3456e6bef5685860f82 Mon Sep 17 00:00:00 2001 From: hadley Date: Mon, 4 May 2015 09:02:28 -0500 Subject: [PATCH 14/44] Regex, not regexp. Fixes #61 --- NEWS.md | 6 ++++-- R/modifiers.r | 10 +++++----- man/modifier-deprecated.Rd | 2 +- man/modifiers.Rd | 2 +- vignettes/stringr.Rmd | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/NEWS.md b/NEWS.md index a8b5eb2a..8417473a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # stringr 1.0.0.9000 +* The replacement to `perl()` is `regex()` not `regexp()` (#61). + # stringr 1.0.0 * stringr is now powered by [stringi](https://github.com/Rexamine/stringi) @@ -44,8 +46,8 @@ make it easier to locate the function you need. * `ignore.case(x)` has been deprecated in favour of - `fixed|regexp|coll(x, ignore.case = TRUE)`, `perl(x)` has been deprecated in - favour of `regexp(x)`. + `fixed|regex|coll(x, ignore.case = TRUE)`, `perl(x)` has been deprecated in + favour of `regex(x)`. * `str_join()` is deprecated, please use `str_c()` instead. diff --git a/R/modifiers.r b/R/modifiers.r index e212e07f..9807e3d2 100644 --- a/R/modifiers.r +++ b/R/modifiers.r @@ -4,7 +4,7 @@ #' \item{fixed}{Compare literal bytes in the string. This is very fast, but #' not usually what you want for non-ASCII character sets.} #' \item{coll}{Compare strings respecting standard collation rules.} -#' \item{regexp}{The default. Uses ICU regular expressions.} +#' \item{regex}{The default. Uses ICU regular expressions.} #' \item{boundary}{Match boundaries between things.} #' } #' @@ -127,14 +127,14 @@ boundary <- function(type = c("character", "line_break", "sentence", "word"), type <- function(x) UseMethod("type") type.boundary <- function(x) "bound" -type.regexp <- function(x) "regex" +type.regex <- function(x) "regex" type.coll <- function(x) "coll" type.fixed <- function(x) "fixed" type.character <- function(x) if (identical(x, "")) "empty" else "regex" #' Deprecated modifier functions. #' -#' Please use \code{\link{regexp}} and \code{\link{coll}} instead. +#' Please use \code{\link{regex}} and \code{\link{coll}} instead. #' #' @name modifier-deprecated #' @keywords internal @@ -143,13 +143,13 @@ NULL #' @export #' @rdname modifier-deprecated ignore.case <- function(string) { - message("Please use (fixed|coll|regexp)(x, ignore_case = TRUE) instead of ignore.case(x)") + message("Please use (fixed|coll|regex)(x, ignore_case = TRUE) instead of ignore.case(x)") fixed(string, ignore_case = TRUE) } #' @export #' @rdname modifier-deprecated perl <- function(pattern) { - message("perl is deprecated. Please use regexp instead") + message("perl is deprecated. Please use regex() instead") regex(pattern) } diff --git a/man/modifier-deprecated.Rd b/man/modifier-deprecated.Rd index ce662f69..372b0ae6 100644 --- a/man/modifier-deprecated.Rd +++ b/man/modifier-deprecated.Rd @@ -11,7 +11,7 @@ ignore.case(string) perl(pattern) } \description{ -Please use \code{\link{regexp}} and \code{\link{coll}} instead. +Please use \code{\link{regex}} and \code{\link{coll}} instead. } \keyword{internal} diff --git a/man/modifiers.Rd b/man/modifiers.Rd index 11d5a555..ecd7b1c2 100644 --- a/man/modifiers.Rd +++ b/man/modifiers.Rd @@ -50,7 +50,7 @@ or numbers - i.e. punctuation.} \item{fixed}{Compare literal bytes in the string. This is very fast, but not usually what you want for non-ASCII character sets.} \item{coll}{Compare strings respecting standard collation rules.} - \item{regexp}{The default. Uses ICU regular expressions.} + \item{regex}{The default. Uses ICU regular expressions.} \item{boundary}{Match boundaries between things.} } } diff --git a/vignettes/stringr.Rmd b/vignettes/stringr.Rmd index 3e79e57e..b3e9a40b 100644 --- a/vignettes/stringr.Rmd +++ b/vignettes/stringr.Rmd @@ -145,7 +145,7 @@ phone <- "([2-9][0-9]{2})[- .]([0-9]{3})[- .]([0-9]{4})" Each pattern matching function has the same first two arguments, a character vector of `string`s to process and a single `pattern` (regular expression) to match. The replace functions have an additional argument specifying the replacement string, and the split functions have an argument to specify the number of pieces. -Unlike base string functions, stringr offers control over matching not through arguments, but through modifier functions, `regexp()`, `coll()` and `fixed()`. This is a deliberate choice made to simplify these functions. For example, while `grepl` has six arguments, `str_detect()` only has two. +Unlike base string functions, stringr offers control over matching not through arguments, but through modifier functions, `regex()`, `coll()` and `fixed()`. This is a deliberate choice made to simplify these functions. For example, while `grepl` has six arguments, `str_detect()` only has two. ### Regular expressions From 8e61e2ff694fc06f23106646c8123662928f6206 Mon Sep 17 00:00:00 2001 From: hadley Date: Mon, 4 May 2015 09:13:39 -0500 Subject: [PATCH 15/44] Switch to new travis config --- .travis.yml | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71eb456e..17e1ba32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,2 @@ -# Sample .travis.yml for R projects from https://github.com/craigcitro/r-travis - -language: c - -before_install: - - curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh - - chmod 755 ./travis-tool.sh - - ./travis-tool.sh bootstrap - -install: - - ./travis-tool.sh install_deps - -script: ./travis-tool.sh run_tests - -after_failure: - - ./travis-tool.sh dump_logs - -env: - global: - - WARNINGS_ARE_ERRORS=1 - - R_BUILD_ARGS=--no-manual - - R_CHECK_ARGS=--no-manual --as-cran - -notifications: - email: - on_success: change - on_failure: change +language: r +warnings_are_errors: true From f074e68ad2872b6d09a6275f575c1465f2ca8a87 Mon Sep 17 00:00:00 2001 From: Chenliang Xu Date: Wed, 6 May 2015 03:27:08 -0500 Subject: [PATCH 16/44] Typo in vignette --- vignettes/stringr.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/stringr.Rmd b/vignettes/stringr.Rmd index b3e9a40b..e20db2e5 100644 --- a/vignettes/stringr.Rmd +++ b/vignettes/stringr.Rmd @@ -58,7 +58,7 @@ There are three string functions that are closely related to their base R equiva from the left of the last character. The end position defaults to `-1`, which corresponds to the last character. -- `str_str<-` is equivalent to `substr<-`, but like `str_sub` it understands +- `str_sub<-` is equivalent to `substr<-`, but like `str_sub` it understands negative indices, and replacement strings not do need to be the same length as the string they are replacing. From b3cefabd2f9eb1899b3a247bcfa74c43b7fb75ae Mon Sep 17 00:00:00 2001 From: Stefan Milton Bache Date: Fri, 29 May 2015 20:59:09 +0200 Subject: [PATCH 17/44] Added str_interp for string interpolation. --- NAMESPACE | 3 +- R/interp.R | 190 +++++++++++++++++++++++++++++++++++ man/case.Rd | 2 +- man/eval_interp_matches.Rd | 25 +++++ man/extract_expressions.Rd | 23 +++++ man/extract_formats.Rd | 23 +++++ man/interp_placeholders.Rd | 24 +++++ man/invert_match.Rd | 2 +- man/match_brace.Rd | 24 +++++ man/modifier-deprecated.Rd | 2 +- man/modifiers.Rd | 2 +- man/pipe.Rd | 2 +- man/str_c.Rd | 2 +- man/str_conv.Rd | 2 +- man/str_count.Rd | 2 +- man/str_detect.Rd | 2 +- man/str_dup.Rd | 2 +- man/str_extract.Rd | 2 +- man/str_interp.Rd | 49 +++++++++ man/str_length.Rd | 2 +- man/str_locate.Rd | 2 +- man/str_match.Rd | 2 +- man/str_order.Rd | 2 +- man/str_pad.Rd | 2 +- man/str_replace.Rd | 2 +- man/str_replace_na.Rd | 2 +- man/str_split.Rd | 2 +- man/str_sub.Rd | 2 +- man/str_subset.Rd | 2 +- man/str_trim.Rd | 2 +- man/str_wrap.Rd | 2 +- man/stringr.Rd | 2 +- man/word.Rd | 2 +- tests/testthat/test-interp.r | 40 ++++++++ 34 files changed, 425 insertions(+), 26 deletions(-) create mode 100644 R/interp.R create mode 100644 man/eval_interp_matches.Rd create mode 100644 man/extract_expressions.Rd create mode 100644 man/extract_formats.Rd create mode 100644 man/interp_placeholders.Rd create mode 100644 man/match_brace.Rd create mode 100644 man/str_interp.Rd create mode 100644 tests/testthat/test-interp.r diff --git a/NAMESPACE b/NAMESPACE index 4a7e8f9f..29311823 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2 (4.1.1): do not edit by hand +# Generated by roxygen2 (4.1.0): do not edit by hand export("%>%") export("str_sub<-") @@ -16,6 +16,7 @@ export(str_detect) export(str_dup) export(str_extract) export(str_extract_all) +export(str_interp) export(str_join) export(str_length) export(str_locate) diff --git a/R/interp.R b/R/interp.R new file mode 100644 index 00000000..d34529a1 --- /dev/null +++ b/R/interp.R @@ -0,0 +1,190 @@ +#' String Interpolation +#' +#' String interpolation is a useful way of specifying a character string which +#' depends on values in a certain environment. It allows for string creation +#' which is easier to read and write when compared to using e.g. +#' \code{\link{paste}} or \code{\link{sprintf}}. The (template) string can +#' include expression placeholders of the form \code{${expression}} or +#' \code{$[format]{expression}}, where expressions are valid R expressions that +#' can be evaluated in the given environment, and \code{format} is a format +#' specification valid for use with \code{\link{sprintf}}. +#' +#' @param string A template character string. +#' @param env The environment in which to evaluate the expressions. +#' +#' @return An interpolated character string. +#' @author Stefan Milton Bache +#' @export +#' @examples +#' +#' # Using values from the environment, and some formats +#' user_name <- "smbache" +#' amount <- 6.656 +#' account <- 1337 +#' str_interp("User ${user_name} (account $[08d]{account}) has $$[.2f]{amount}.") +#' +#' # Nested brace pairs work inside expressions too, and any braces can be +#' # placed outside the expressions. +#' str_interp("Works with } nested { braces too: $[.2f]{{{2 + 2}*{amount}}}") +#' +#' # Values can also come from a list +#' str_interp("One value, ${value1}, and then another, ${value2*2}.", +#' list(value1 = 10, value2 = 20)) +#' +#' # Or a data frame +#' str_interp("Values are $[.2f]{max(Sepal.Width)} and $[.2f]{min(Sepal.Width)}.", +#' iris) +str_interp <- function(string, env = parent.frame()) +{ + # Find expression placeholders + matches <- interp_placeholders(string) + + # Evaluate them to get the replacement strings. + replacements <- eval_interp_matches(matches$matches, env) + + # Replace the expressions by their values and return. + `regmatches<-`(string, list(matches$indices), FALSE, list(replacements)) +} + +#' Match String Interpolation Placeholders +#' +#' Given a character string a set of expression placeholders are matched. They +#' are of the form \code{${...}} or optionally \code{$[f]{...}} where \code{f} +#' is a valid format for \code{\link{sprintf}}. +#' +#' @param string character: The string to be interpolated. +#' +#' @return list containing \code{indices} (regex match data) and \code{matches}, +#' the string representations of matched expressions. +#' +#' @author Stefan Milton Bache +interp_placeholders <- function(string) +{ + # Find starting position of ${} or $[]{} placeholders. + starts <- gregexpr("\\$(\\[.*?\\])?\\{", string)[[1]] + + # Break up the string in parts + parts <- substr(rep(string, length(starts)), + start = starts, + stop = c(starts[-1L] - 1L, nchar(string))) + + # For each part, find the opening and closing braces. + opens <- lapply(strsplit(parts, ""), function(v) which(v == "{")) + closes <- lapply(strsplit(parts, ""), function(v) which(v == "}")) + + # Identify the positions within the parts of the matching closing braces. + # These are the lengths of the placeholder matches. + lengths <- mapply(match_brace, opens, closes) + + # Update the `starts` match data with the + attr(starts, "match.length") <- lengths + + # Return both the indices (regex match data) and the actual placeholder + # matches (as strings.) + list(indices = starts, + matches = mapply(substr, starts, starts + lengths - 1, x = string)) +} + +#' Evaluate String Interpolation Matches +#' +#' The expression part of string interpolation matches are evaluated in a +#' specified environment and formatted for replacement in the original string. +#' Used internally by \code{\link{str_interp}}. +#' +#' @param matches Match data +#' +#' @param env The environment in which to evaluate the expressions. +#' +#' @return A character vector of replacement strings. +#' +#' @author Stefan Milton Bache +eval_interp_matches <- function(matches, env) +{ + # Extract expressions from the matches + expressions <- extract_expressions(matches) + + # Evaluate them in the given environment + values <- lapply(expressions, eval, env = env, + enclos = if (is.environment(env)) env else environment(env)) + + # Find the formats to be used + formats <- extract_formats(matches) + + # Format the values and return. + mapply(sprintf, formats, values) +} + +#' Extract Expression Objects from String Interpolation Matches +#' +#' An interpolation match object will contain both its wrapping \code{${ }} part +#' and possibly a format. This extracts the expression parts and parses them to +#' prepare them for evaluation. +#' +#' @param matches Match data +#' +#' @return list of R expressions +#' +#' @author Stefan Milton Bache +extract_expressions <- function(matches) +{ + # Parse function for text argument as first argument. + parse_text <- function(text) parse(text = text) + + # string representation of the expressions (without the possible formats). + strings <- gsub("\\$(\\[.+?\\])?\\{", "", matches) + + # Remove the trailing closing brace and parse. + lapply(substr(strings, 1L, nchar(strings) - 1), parse_text) +} + + +#' Extract String Interpolation Formats from Matched Placeholders +#' +#' An expression placeholder for string interpolation may optionally contain a +#' format valid for \code{\link{sprintf}}. This function will extract such or +#' default to "s" the format for strings. +#' +#' @param matches Match data +#' +#' @return A character vector of format specifiers. +#' +#' @author Stefan Milton Bache +extract_formats <- function(matches) +{ + # Extract the optional format parts. + formats <- gsub("\\$(\\[(.+?)\\])?.*", "\\2", matches) + + # Use string options "s" as default when not specified. + paste0("%", ifelse(formats == "", "s", formats)) +} + +#' Utility Function for Matching a Closing Brace +#' +#' Given positions of opening and closing braces \code{match_brace} identifies +#' the closing brace matching the first opening brace. +#' +#' @param opening integer: Vector with positions of opening braces. +#' +#' @param closing integer: Vector with positions of closing braces. +#' +#' @return Integer with the posision of the matching brace. +#' +#' @author Stefan Milton Bache +match_brace <- function(opening, closing) +{ + # maximum index for the matching closing brace + max_close <- max(closing) + + # "path" for mapping opening and closing breaces + path <- numeric(max_close) + + # Set openings to 1, and closings to -1 + path[opening[opening < max_close]] <- 1 + path[closing] <- -1 + + # Cumulate the path ... + cumpath <- cumsum(path) + + # ... and the first 0 after the first opening identifies the match. + min(which(1:max_close > min(which(cumpath == 1)) & cumpath == 0)) +} diff --git a/man/case.Rd b/man/case.Rd index c5dbb117..92d56bed 100644 --- a/man/case.Rd +++ b/man/case.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/case.R \name{case} \alias{case} diff --git a/man/eval_interp_matches.Rd b/man/eval_interp_matches.Rd new file mode 100644 index 00000000..e18bf384 --- /dev/null +++ b/man/eval_interp_matches.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2 (4.1.0): do not edit by hand +% Please edit documentation in R/interp.R +\name{eval_interp_matches} +\alias{eval_interp_matches} +\title{Evaluate String Interpolation Matches} +\usage{ +eval_interp_matches(matches, env) +} +\arguments{ +\item{matches}{Match data} + +\item{env}{The environment in which to evaluate the expressions.} +} +\value{ +A character vector of replacement strings. +} +\description{ +The expression part of string interpolation matches are evaluated in a +specified environment and formatted for replacement in the original string. +Used internally by \code{\link{str_interp}}. +} +\author{ +Stefan Milton Bache +} + diff --git a/man/extract_expressions.Rd b/man/extract_expressions.Rd new file mode 100644 index 00000000..6236e8d1 --- /dev/null +++ b/man/extract_expressions.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2 (4.1.0): do not edit by hand +% Please edit documentation in R/interp.R +\name{extract_expressions} +\alias{extract_expressions} +\title{Extract Expression Objects from String Interpolation Matches} +\usage{ +extract_expressions(matches) +} +\arguments{ +\item{matches}{Match data} +} +\value{ +list of R expressions +} +\description{ +An interpolation match object will contain both its wrapping \code{${ }} part +and possibly a format. This extracts the expression parts and parses them to +prepare them for evaluation. +} +\author{ +Stefan Milton Bache +} + diff --git a/man/extract_formats.Rd b/man/extract_formats.Rd new file mode 100644 index 00000000..675d3ac0 --- /dev/null +++ b/man/extract_formats.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2 (4.1.0): do not edit by hand +% Please edit documentation in R/interp.R +\name{extract_formats} +\alias{extract_formats} +\title{Extract String Interpolation Formats from Matched Placeholders} +\usage{ +extract_formats(matches) +} +\arguments{ +\item{matches}{Match data} +} +\value{ +A character vector of format specifiers. +} +\description{ +An expression placeholder for string interpolation may optionally contain a +format valid for \code{\link{sprintf}}. This function will extract such or +default to "s" the format for strings. +} +\author{ +Stefan Milton Bache +} + diff --git a/man/interp_placeholders.Rd b/man/interp_placeholders.Rd new file mode 100644 index 00000000..0c9826a3 --- /dev/null +++ b/man/interp_placeholders.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2 (4.1.0): do not edit by hand +% Please edit documentation in R/interp.R +\name{interp_placeholders} +\alias{interp_placeholders} +\title{Match String Interpolation Placeholders} +\usage{ +interp_placeholders(string) +} +\arguments{ +\item{string}{character: The string to be interpolated.} +} +\value{ +list containing \code{indices} (regex match data) and \code{matches}, + the string representations of matched expressions. +} +\description{ +Given a character string a set of expression placeholders are matched. They +are of the form \code{${...}} or optionally \code{$[f]{...}} where \code{f} +is a valid format for \code{\link{sprintf}}. +} +\author{ +Stefan Milton Bache +} + diff --git a/man/invert_match.Rd b/man/invert_match.Rd index b705ba0a..92619f8b 100644 --- a/man/invert_match.Rd +++ b/man/invert_match.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/locate.r \name{invert_match} \alias{invert_match} diff --git a/man/match_brace.Rd b/man/match_brace.Rd new file mode 100644 index 00000000..ddc730a9 --- /dev/null +++ b/man/match_brace.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2 (4.1.0): do not edit by hand +% Please edit documentation in R/interp.R +\name{match_brace} +\alias{match_brace} +\title{Utility Function for Matching a Closing Brace} +\usage{ +match_brace(opening, closing) +} +\arguments{ +\item{opening}{integer: Vector with positions of opening braces.} + +\item{closing}{integer: Vector with positions of closing braces.} +} +\value{ +Integer with the posision of the matching brace. +} +\description{ +Given positions of opening and closing braces \code{match_brace} identifies +the closing brace matching the first opening brace. +} +\author{ +Stefan Milton Bache +} + diff --git a/man/modifier-deprecated.Rd b/man/modifier-deprecated.Rd index 372b0ae6..50565eda 100644 --- a/man/modifier-deprecated.Rd +++ b/man/modifier-deprecated.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/modifiers.r \name{modifier-deprecated} \alias{ignore.case} diff --git a/man/modifiers.Rd b/man/modifiers.Rd index ecd7b1c2..8c5aa6a4 100644 --- a/man/modifiers.Rd +++ b/man/modifiers.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/modifiers.r \name{modifiers} \alias{boundary} diff --git a/man/pipe.Rd b/man/pipe.Rd index 860620e6..08a8b061 100644 --- a/man/pipe.Rd +++ b/man/pipe.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/utils.R \name{\%>\%} \alias{\%>\%} diff --git a/man/str_c.Rd b/man/str_c.Rd index 0b2b2e41..bf60e137 100644 --- a/man/str_c.Rd +++ b/man/str_c.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/c.r \name{str_c} \alias{str_c} diff --git a/man/str_conv.Rd b/man/str_conv.Rd index 68b574fa..252d4528 100644 --- a/man/str_conv.Rd +++ b/man/str_conv.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/conv.R \name{str_conv} \alias{str_conv} diff --git a/man/str_count.Rd b/man/str_count.Rd index 138569de..38cb61bd 100644 --- a/man/str_count.Rd +++ b/man/str_count.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/count.r \name{str_count} \alias{str_count} diff --git a/man/str_detect.Rd b/man/str_detect.Rd index 8d9f9562..afdad9b6 100644 --- a/man/str_detect.Rd +++ b/man/str_detect.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/detect.r \name{str_detect} \alias{str_detect} diff --git a/man/str_dup.Rd b/man/str_dup.Rd index c07e3d16..1d6b1c9d 100644 --- a/man/str_dup.Rd +++ b/man/str_dup.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/dup.r \name{str_dup} \alias{str_dup} diff --git a/man/str_extract.Rd b/man/str_extract.Rd index 32d96d9d..6b358654 100644 --- a/man/str_extract.Rd +++ b/man/str_extract.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/extract.r \name{str_extract} \alias{str_extract} diff --git a/man/str_interp.Rd b/man/str_interp.Rd new file mode 100644 index 00000000..33abeb4d --- /dev/null +++ b/man/str_interp.Rd @@ -0,0 +1,49 @@ +% Generated by roxygen2 (4.1.0): do not edit by hand +% Please edit documentation in R/interp.R +\name{str_interp} +\alias{str_interp} +\title{String Interpolation} +\usage{ +str_interp(string, env = parent.frame()) +} +\arguments{ +\item{string}{A template character string.} + +\item{env}{The environment in which to evaluate the expressions.} +} +\value{ +An interpolated character string. +} +\description{ +String interpolation is a useful way of specifying a character string which +depends on values in a certain environment. It allows for string creation +which is easier to read and write when compared to using e.g. +\code{\link{paste}} or \code{\link{sprintf}}. The (template) string can +include expression placeholders of the form \code{${expression}} or +\code{$[format]{expression}}, where expressions are valid R expressions that +can be evaluated in the given environment, and \code{format} is a format +specification valid for use with \code{\link{sprintf}}. +} +\examples{ +# Using values from the environment, and some formats +user_name <- "smbache" +amount <- 6.656 +account <- 1337 +str_interp("User ${user_name} (account $[08d]{account}) has $$[.2f]{amount}.") + +# Nested brace pairs work inside expressions too, and any braces can be +# placed outside the expressions. +str_interp("Works with } nested { braces too: $[.2f]{{{2 + 2}*{amount}}}") + +# Values can also come from a list +str_interp("One value, ${value1}, and then another, ${value2*2}.", + list(value1 = 10, value2 = 20)) + +# Or a data frame +str_interp("Values are $[.2f]{max(Sepal.Width)} and $[.2f]{min(Sepal.Width)}.", + iris) +} +\author{ +Stefan Milton Bache +} + diff --git a/man/str_length.Rd b/man/str_length.Rd index e4b04f03..920c5934 100644 --- a/man/str_length.Rd +++ b/man/str_length.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/length.r \name{str_length} \alias{str_length} diff --git a/man/str_locate.Rd b/man/str_locate.Rd index e68c5745..040809f8 100644 --- a/man/str_locate.Rd +++ b/man/str_locate.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/locate.r \name{str_locate} \alias{str_locate} diff --git a/man/str_match.Rd b/man/str_match.Rd index a3f16c74..9fea6ebb 100644 --- a/man/str_match.Rd +++ b/man/str_match.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/match.r \name{str_match} \alias{str_match} diff --git a/man/str_order.Rd b/man/str_order.Rd index 64150843..90f37720 100644 --- a/man/str_order.Rd +++ b/man/str_order.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/sort.R \name{str_order} \alias{str_order} diff --git a/man/str_pad.Rd b/man/str_pad.Rd index 3af12fb2..5ef80287 100644 --- a/man/str_pad.Rd +++ b/man/str_pad.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/pad-trim.r \name{str_pad} \alias{str_pad} diff --git a/man/str_replace.Rd b/man/str_replace.Rd index 813b07eb..6359c890 100644 --- a/man/str_replace.Rd +++ b/man/str_replace.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/replace.r \name{str_replace} \alias{str_replace} diff --git a/man/str_replace_na.Rd b/man/str_replace_na.Rd index c38248f0..37e58cd2 100644 --- a/man/str_replace_na.Rd +++ b/man/str_replace_na.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/replace.r \name{str_replace_na} \alias{str_replace_na} diff --git a/man/str_split.Rd b/man/str_split.Rd index a66ae2ed..84cc7075 100644 --- a/man/str_split.Rd +++ b/man/str_split.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/split.r \name{str_split} \alias{str_split} diff --git a/man/str_sub.Rd b/man/str_sub.Rd index 73d70740..597e2389 100644 --- a/man/str_sub.Rd +++ b/man/str_sub.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/sub.r \name{str_sub} \alias{str_sub} diff --git a/man/str_subset.Rd b/man/str_subset.Rd index 94a4ee13..91778ac3 100644 --- a/man/str_subset.Rd +++ b/man/str_subset.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/subset.R \name{str_subset} \alias{str_subset} diff --git a/man/str_trim.Rd b/man/str_trim.Rd index 6f15123a..aa292893 100644 --- a/man/str_trim.Rd +++ b/man/str_trim.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/pad-trim.r \name{str_trim} \alias{str_trim} diff --git a/man/str_wrap.Rd b/man/str_wrap.Rd index 228419f6..c2a68b37 100644 --- a/man/str_wrap.Rd +++ b/man/str_wrap.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/wrap.r \name{str_wrap} \alias{str_wrap} diff --git a/man/stringr.Rd b/man/stringr.Rd index 28f8280a..a49955dd 100644 --- a/man/stringr.Rd +++ b/man/stringr.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/stringr.R \name{stringr} \alias{stringr} diff --git a/man/word.Rd b/man/word.Rd index cb444146..02642e83 100644 --- a/man/word.Rd +++ b/man/word.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/word.r \name{word} \alias{word} diff --git a/tests/testthat/test-interp.r b/tests/testthat/test-interp.r new file mode 100644 index 00000000..7b889fbf --- /dev/null +++ b/tests/testthat/test-interp.r @@ -0,0 +1,40 @@ +context("String Interpolation") + +test_that("str_interp works with default env", { + + subject <- "statistics" + number <- 7 + floating <- 6.656 + + s <- str_interp("I like ${subject} and the number $[d]{number}. Also $[.2f]{floating}.") + + expect_that(s, is_identical_to("I like statistics and the number 7. Also 6.66.")) + + pi_s <- str_interp("Pi is approximately $[.5f]{pi}") + expect_that(pi_s, is_identical_to("Pi is approximately 3.14159")) + +}) + +test_that("str_interp works with lists and data frames.", { + + ls <- str_interp("One value, ${value1}, and then another, ${value2*2}.", + list(value1 = 10, value2 = 20)) + + expect_that(ls, is_identical_to("One value, 10, and then another, 40.")) + + ds <- str_interp("Values are $[.2f]{max(Sepal.Width)} and $[.2f]{min(Sepal.Width)}.", + iris) + + expect_that(ds, is_identical_to("Values are 4.40 and 2.00.")) + + +}) + +test_that("str_interp works with nested expressions", { + + amount <- 1337 + s <- str_interp("Works with } nested { braces too: $[.2f]{{{2 + 2}*{amount}}}") + + expect_that(s, is_identical_to("Works with } nested { braces too: 5348.00")) + +}) From ad8d707bb493f9934a5b22de96fe3cd0de551bad Mon Sep 17 00:00:00 2001 From: Stefan Milton Bache Date: Fri, 29 May 2015 21:18:03 +0200 Subject: [PATCH 18/44] updated roxygen2, added @noRd to internal functions. --- NAMESPACE | 2 +- R/interp.R | 5 +++++ man/case.Rd | 2 +- man/eval_interp_matches.Rd | 25 ------------------------- man/extract_expressions.Rd | 23 ----------------------- man/extract_formats.Rd | 23 ----------------------- man/interp_placeholders.Rd | 24 ------------------------ man/invert_match.Rd | 2 +- man/match_brace.Rd | 24 ------------------------ man/modifier-deprecated.Rd | 2 +- man/modifiers.Rd | 2 +- man/pipe.Rd | 2 +- man/str_c.Rd | 2 +- man/str_conv.Rd | 2 +- man/str_count.Rd | 2 +- man/str_detect.Rd | 2 +- man/str_dup.Rd | 2 +- man/str_extract.Rd | 2 +- man/str_interp.Rd | 2 +- man/str_length.Rd | 2 +- man/str_locate.Rd | 2 +- man/str_match.Rd | 2 +- man/str_order.Rd | 2 +- man/str_pad.Rd | 2 +- man/str_replace.Rd | 2 +- man/str_replace_na.Rd | 2 +- man/str_split.Rd | 2 +- man/str_sub.Rd | 2 +- man/str_subset.Rd | 2 +- man/str_trim.Rd | 2 +- man/str_wrap.Rd | 2 +- man/stringr.Rd | 2 +- man/word.Rd | 2 +- 33 files changed, 32 insertions(+), 146 deletions(-) delete mode 100644 man/eval_interp_matches.Rd delete mode 100644 man/extract_expressions.Rd delete mode 100644 man/extract_formats.Rd delete mode 100644 man/interp_placeholders.Rd delete mode 100644 man/match_brace.Rd diff --git a/NAMESPACE b/NAMESPACE index 29311823..d423f856 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2 (4.1.0): do not edit by hand +# Generated by roxygen2 (4.1.1): do not edit by hand export("%>%") export("str_sub<-") diff --git a/R/interp.R b/R/interp.R index d34529a1..ec0cc20a 100644 --- a/R/interp.R +++ b/R/interp.R @@ -57,6 +57,7 @@ str_interp <- function(string, env = parent.frame()) #' @return list containing \code{indices} (regex match data) and \code{matches}, #' the string representations of matched expressions. #' +#' @noRd #' @author Stefan Milton Bache interp_placeholders <- function(string) { @@ -97,6 +98,7 @@ interp_placeholders <- function(string) #' #' @return A character vector of replacement strings. #' +#' @noRd #' @author Stefan Milton Bache eval_interp_matches <- function(matches, env) { @@ -124,6 +126,7 @@ eval_interp_matches <- function(matches, env) #' #' @return list of R expressions #' +#' @noRd #' @author Stefan Milton Bache extract_expressions <- function(matches) { @@ -148,6 +151,7 @@ extract_expressions <- function(matches) #' #' @return A character vector of format specifiers. #' +#' @noRd #' @author Stefan Milton Bache extract_formats <- function(matches) { @@ -169,6 +173,7 @@ extract_formats <- function(matches) #' #' @return Integer with the posision of the matching brace. #' +#' @noRd #' @author Stefan Milton Bache match_brace <- function(opening, closing) { diff --git a/man/case.Rd b/man/case.Rd index 92d56bed..c5dbb117 100644 --- a/man/case.Rd +++ b/man/case.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/case.R \name{case} \alias{case} diff --git a/man/eval_interp_matches.Rd b/man/eval_interp_matches.Rd deleted file mode 100644 index e18bf384..00000000 --- a/man/eval_interp_matches.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand -% Please edit documentation in R/interp.R -\name{eval_interp_matches} -\alias{eval_interp_matches} -\title{Evaluate String Interpolation Matches} -\usage{ -eval_interp_matches(matches, env) -} -\arguments{ -\item{matches}{Match data} - -\item{env}{The environment in which to evaluate the expressions.} -} -\value{ -A character vector of replacement strings. -} -\description{ -The expression part of string interpolation matches are evaluated in a -specified environment and formatted for replacement in the original string. -Used internally by \code{\link{str_interp}}. -} -\author{ -Stefan Milton Bache -} - diff --git a/man/extract_expressions.Rd b/man/extract_expressions.Rd deleted file mode 100644 index 6236e8d1..00000000 --- a/man/extract_expressions.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand -% Please edit documentation in R/interp.R -\name{extract_expressions} -\alias{extract_expressions} -\title{Extract Expression Objects from String Interpolation Matches} -\usage{ -extract_expressions(matches) -} -\arguments{ -\item{matches}{Match data} -} -\value{ -list of R expressions -} -\description{ -An interpolation match object will contain both its wrapping \code{${ }} part -and possibly a format. This extracts the expression parts and parses them to -prepare them for evaluation. -} -\author{ -Stefan Milton Bache -} - diff --git a/man/extract_formats.Rd b/man/extract_formats.Rd deleted file mode 100644 index 675d3ac0..00000000 --- a/man/extract_formats.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand -% Please edit documentation in R/interp.R -\name{extract_formats} -\alias{extract_formats} -\title{Extract String Interpolation Formats from Matched Placeholders} -\usage{ -extract_formats(matches) -} -\arguments{ -\item{matches}{Match data} -} -\value{ -A character vector of format specifiers. -} -\description{ -An expression placeholder for string interpolation may optionally contain a -format valid for \code{\link{sprintf}}. This function will extract such or -default to "s" the format for strings. -} -\author{ -Stefan Milton Bache -} - diff --git a/man/interp_placeholders.Rd b/man/interp_placeholders.Rd deleted file mode 100644 index 0c9826a3..00000000 --- a/man/interp_placeholders.Rd +++ /dev/null @@ -1,24 +0,0 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand -% Please edit documentation in R/interp.R -\name{interp_placeholders} -\alias{interp_placeholders} -\title{Match String Interpolation Placeholders} -\usage{ -interp_placeholders(string) -} -\arguments{ -\item{string}{character: The string to be interpolated.} -} -\value{ -list containing \code{indices} (regex match data) and \code{matches}, - the string representations of matched expressions. -} -\description{ -Given a character string a set of expression placeholders are matched. They -are of the form \code{${...}} or optionally \code{$[f]{...}} where \code{f} -is a valid format for \code{\link{sprintf}}. -} -\author{ -Stefan Milton Bache -} - diff --git a/man/invert_match.Rd b/man/invert_match.Rd index 92619f8b..b705ba0a 100644 --- a/man/invert_match.Rd +++ b/man/invert_match.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/locate.r \name{invert_match} \alias{invert_match} diff --git a/man/match_brace.Rd b/man/match_brace.Rd deleted file mode 100644 index ddc730a9..00000000 --- a/man/match_brace.Rd +++ /dev/null @@ -1,24 +0,0 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand -% Please edit documentation in R/interp.R -\name{match_brace} -\alias{match_brace} -\title{Utility Function for Matching a Closing Brace} -\usage{ -match_brace(opening, closing) -} -\arguments{ -\item{opening}{integer: Vector with positions of opening braces.} - -\item{closing}{integer: Vector with positions of closing braces.} -} -\value{ -Integer with the posision of the matching brace. -} -\description{ -Given positions of opening and closing braces \code{match_brace} identifies -the closing brace matching the first opening brace. -} -\author{ -Stefan Milton Bache -} - diff --git a/man/modifier-deprecated.Rd b/man/modifier-deprecated.Rd index 50565eda..372b0ae6 100644 --- a/man/modifier-deprecated.Rd +++ b/man/modifier-deprecated.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/modifiers.r \name{modifier-deprecated} \alias{ignore.case} diff --git a/man/modifiers.Rd b/man/modifiers.Rd index 8c5aa6a4..ecd7b1c2 100644 --- a/man/modifiers.Rd +++ b/man/modifiers.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/modifiers.r \name{modifiers} \alias{boundary} diff --git a/man/pipe.Rd b/man/pipe.Rd index 08a8b061..860620e6 100644 --- a/man/pipe.Rd +++ b/man/pipe.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/utils.R \name{\%>\%} \alias{\%>\%} diff --git a/man/str_c.Rd b/man/str_c.Rd index bf60e137..0b2b2e41 100644 --- a/man/str_c.Rd +++ b/man/str_c.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/c.r \name{str_c} \alias{str_c} diff --git a/man/str_conv.Rd b/man/str_conv.Rd index 252d4528..68b574fa 100644 --- a/man/str_conv.Rd +++ b/man/str_conv.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/conv.R \name{str_conv} \alias{str_conv} diff --git a/man/str_count.Rd b/man/str_count.Rd index 38cb61bd..138569de 100644 --- a/man/str_count.Rd +++ b/man/str_count.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/count.r \name{str_count} \alias{str_count} diff --git a/man/str_detect.Rd b/man/str_detect.Rd index afdad9b6..8d9f9562 100644 --- a/man/str_detect.Rd +++ b/man/str_detect.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/detect.r \name{str_detect} \alias{str_detect} diff --git a/man/str_dup.Rd b/man/str_dup.Rd index 1d6b1c9d..c07e3d16 100644 --- a/man/str_dup.Rd +++ b/man/str_dup.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/dup.r \name{str_dup} \alias{str_dup} diff --git a/man/str_extract.Rd b/man/str_extract.Rd index 6b358654..32d96d9d 100644 --- a/man/str_extract.Rd +++ b/man/str_extract.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/extract.r \name{str_extract} \alias{str_extract} diff --git a/man/str_interp.Rd b/man/str_interp.Rd index 33abeb4d..331d3c40 100644 --- a/man/str_interp.Rd +++ b/man/str_interp.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/interp.R \name{str_interp} \alias{str_interp} diff --git a/man/str_length.Rd b/man/str_length.Rd index 920c5934..e4b04f03 100644 --- a/man/str_length.Rd +++ b/man/str_length.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/length.r \name{str_length} \alias{str_length} diff --git a/man/str_locate.Rd b/man/str_locate.Rd index 040809f8..e68c5745 100644 --- a/man/str_locate.Rd +++ b/man/str_locate.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/locate.r \name{str_locate} \alias{str_locate} diff --git a/man/str_match.Rd b/man/str_match.Rd index 9fea6ebb..a3f16c74 100644 --- a/man/str_match.Rd +++ b/man/str_match.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/match.r \name{str_match} \alias{str_match} diff --git a/man/str_order.Rd b/man/str_order.Rd index 90f37720..64150843 100644 --- a/man/str_order.Rd +++ b/man/str_order.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/sort.R \name{str_order} \alias{str_order} diff --git a/man/str_pad.Rd b/man/str_pad.Rd index 5ef80287..3af12fb2 100644 --- a/man/str_pad.Rd +++ b/man/str_pad.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/pad-trim.r \name{str_pad} \alias{str_pad} diff --git a/man/str_replace.Rd b/man/str_replace.Rd index 6359c890..813b07eb 100644 --- a/man/str_replace.Rd +++ b/man/str_replace.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/replace.r \name{str_replace} \alias{str_replace} diff --git a/man/str_replace_na.Rd b/man/str_replace_na.Rd index 37e58cd2..c38248f0 100644 --- a/man/str_replace_na.Rd +++ b/man/str_replace_na.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/replace.r \name{str_replace_na} \alias{str_replace_na} diff --git a/man/str_split.Rd b/man/str_split.Rd index 84cc7075..a66ae2ed 100644 --- a/man/str_split.Rd +++ b/man/str_split.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/split.r \name{str_split} \alias{str_split} diff --git a/man/str_sub.Rd b/man/str_sub.Rd index 597e2389..73d70740 100644 --- a/man/str_sub.Rd +++ b/man/str_sub.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/sub.r \name{str_sub} \alias{str_sub} diff --git a/man/str_subset.Rd b/man/str_subset.Rd index 91778ac3..94a4ee13 100644 --- a/man/str_subset.Rd +++ b/man/str_subset.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/subset.R \name{str_subset} \alias{str_subset} diff --git a/man/str_trim.Rd b/man/str_trim.Rd index aa292893..6f15123a 100644 --- a/man/str_trim.Rd +++ b/man/str_trim.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/pad-trim.r \name{str_trim} \alias{str_trim} diff --git a/man/str_wrap.Rd b/man/str_wrap.Rd index c2a68b37..228419f6 100644 --- a/man/str_wrap.Rd +++ b/man/str_wrap.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/wrap.r \name{str_wrap} \alias{str_wrap} diff --git a/man/stringr.Rd b/man/stringr.Rd index a49955dd..28f8280a 100644 --- a/man/stringr.Rd +++ b/man/stringr.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/stringr.R \name{stringr} \alias{stringr} diff --git a/man/word.Rd b/man/word.Rd index 02642e83..cb444146 100644 --- a/man/word.Rd +++ b/man/word.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/word.r \name{word} \alias{word} From 463c3451e0a62c8e37f77b62558442d14fb399ca Mon Sep 17 00:00:00 2001 From: smbache Date: Sun, 31 May 2015 14:54:05 +0200 Subject: [PATCH 19/44] Fixed a bug when no placeholder are found in str_interp. Added feature to use a formula and hyphens to break long lines in the source code. --- R/interp.R | 48 +++++++++++++++++++++++++++++++++++++++++++---- man/str_interp.Rd | 5 +++++ 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/R/interp.R b/R/interp.R index ec0cc20a..f2a4b9f7 100644 --- a/R/interp.R +++ b/R/interp.R @@ -34,16 +34,52 @@ #' # Or a data frame #' str_interp("Values are $[.2f]{max(Sepal.Width)} and $[.2f]{min(Sepal.Width)}.", #' iris) +#' +#' # Use a formula and hyphens when the string is long +#' max_char <- 80 +#' str_interp(~"This particular line is so long that it is hard to write "- +#' "without breaking the ${max_char}-char barrier!") str_interp <- function(string, env = parent.frame()) { + + if ("formula" %in% class(string)) + string <- unwrap_string_formula(string) + else if (!is.character(string)) + stop("string argument is not character.", call. = FALSE) + # Find expression placeholders matches <- interp_placeholders(string) - # Evaluate them to get the replacement strings. - replacements <- eval_interp_matches(matches$matches, env) + # Determine if any placeholders were found. + if (matches$indices[1] <= 0) { + string + } else { + # Evaluate them to get the replacement strings. + replacements <- eval_interp_matches(matches$matches, env) + + # Replace the expressions by their values and return. + `regmatches<-`(string, list(matches$indices), FALSE, list(replacements)) + } +} - # Replace the expressions by their values and return. - `regmatches<-`(string, list(matches$indices), FALSE, list(replacements)) +#' Unwrap String Formula +#' +#' A string formula allows for concatenating long strings using a +#' hyphen (dash). This is useful for writing a single long lines +#' in multiple lines of source code without having to use a nested +#' \code{paste} or \code{sprintf}. +#' +#' @param fs a formula with one or more strings separated by hypens. +#' @return character +#' @noRd +#' @example +#' unwrap_string_formula(~"This is a long line which is hard to write without "- +#' "breaking the 80-char barrier") +unwrap_string_formula <- function(fs) +{ + # Hyphen + `-` <- function(a, b) paste0(a, b) + eval(fs[[length(fs)]]) } #' Match String Interpolation Placeholders @@ -64,6 +100,10 @@ interp_placeholders <- function(string) # Find starting position of ${} or $[]{} placeholders. starts <- gregexpr("\\$(\\[.*?\\])?\\{", string)[[1]] + # Return immediately if no matches are found. + if (starts[1] <= 0) + return(list(indices = starts)) + # Break up the string in parts parts <- substr(rep(string, length(starts)), start = starts, diff --git a/man/str_interp.Rd b/man/str_interp.Rd index 331d3c40..2850a239 100644 --- a/man/str_interp.Rd +++ b/man/str_interp.Rd @@ -42,6 +42,11 @@ str_interp("One value, ${value1}, and then another, ${value2*2}.", # Or a data frame str_interp("Values are $[.2f]{max(Sepal.Width)} and $[.2f]{min(Sepal.Width)}.", iris) + +# Use a formula and hyphens when the string is long +max_char <- 80 +str_interp(~"This particular line is so long that it is hard to write "- + "without breaking the ${max_char}-char barrier!") } \author{ Stefan Milton Bache From da263ea3de21193f7fcac6e4af882f4e04f82177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Fri, 5 Jun 2015 13:37:17 -0400 Subject: [PATCH 20/44] Add URL & BugReports to DESCRIPTION --- DESCRIPTION | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index 93a9f0a0..7063c63e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,3 +20,5 @@ Suggests: testthat, knitr VignetteBuilder: knitr +URL: https://github.com/hadley/stringr +BugReports: https://github.com/hadley/stringr/issues From 123dab30440f77e112585b2a201b9818a9234a31 Mon Sep 17 00:00:00 2001 From: gagolews Date: Sun, 7 Jun 2015 11:51:02 +0200 Subject: [PATCH 21/44] str_subset fixed case_insensitive patch --- R/subset.R | 3 ++- tests/testthat/test-subset.r | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/testthat/test-subset.r diff --git a/R/subset.R b/R/subset.R index 6b3f5cf9..7c85b192 100644 --- a/R/subset.R +++ b/R/subset.R @@ -22,7 +22,8 @@ str_subset <- function(string, pattern) { switch(type(pattern), empty = , bound = stop("Not implemented", call. = FALSE), - fixed = stri_subset_fixed(string, pattern, omit_na = TRUE), + fixed = stri_subset_fixed(string, pattern, omit_na = TRUE, + opts_fixed = attr(pattern, "options")), coll = stri_subset_coll(string, pattern, omit_na = TRUE, opts_collator = attr(pattern, "options")), regex = stri_subset_regex(string, pattern, omit_na = TRUE, diff --git a/tests/testthat/test-subset.r b/tests/testthat/test-subset.r new file mode 100644 index 00000000..daed662d --- /dev/null +++ b/tests/testthat/test-subset.r @@ -0,0 +1,7 @@ +context("Subsetting character vectors") + +test_that("basic subsetting for fixed patterns works", { + expect_that(str_subset(c("i", "I"), fixed("i")), equals("i")) + expect_that(str_subset(c("i", "I"), fixed("i", ignore_case=TRUE)), equals(c("i", "I"))) +}) + From 5e7fa033734faf363e3301eeda4e8ba06cc5edd0 Mon Sep 17 00:00:00 2001 From: gagolews Date: Sun, 7 Jun 2015 11:59:43 +0200 Subject: [PATCH 22/44] updated stringi man links --- R/c.r | 2 +- R/extract.r | 4 ++-- man/str_c.Rd | 2 +- man/str_extract.Rd | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/c.r b/R/c.r index 7df59939..c33fa0eb 100644 --- a/R/c.r +++ b/R/c.r @@ -17,7 +17,7 @@ #' length equal to the longest input string. If \code{collapse} is #' non-NULL, a character vector of length 1. #' @seealso \code{\link{paste}} for equivalent base R functionality, and -#' \code{\link[stringi]{stri_c}} which this function wraps +#' \code{\link[stringi]{stri_join}} which this function wraps #' @export str_c #' @examples #' str_c("Letter: ", letters) diff --git a/R/extract.r b/R/extract.r index 254a6429..b39d6260 100644 --- a/R/extract.r +++ b/R/extract.r @@ -4,8 +4,8 @@ #' #' @inheritParams str_detect #' @return A character vector. -#' @seealso \code{\link[stringi]{stri_extract_first}} and -#' \code{\link[stringi]{stri_extract_all}} for the underlying +#' @seealso \code{\link[stringi]{stri_extract}} and +#' \code{\link[stringi]{stri_extract}} for the underlying #' implementation. #' @param simplify If \code{FALSE}, the default, returns a list of character #' vectors. If \code{TRUE} returns a character matrix. diff --git a/man/str_c.Rd b/man/str_c.Rd index 0b2b2e41..fa81bdde 100644 --- a/man/str_c.Rd +++ b/man/str_c.Rd @@ -48,6 +48,6 @@ str_c(str_replace_na(c("a", NA, "b")), "-d") } \seealso{ \code{\link{paste}} for equivalent base R functionality, and - \code{\link[stringi]{stri_c}} which this function wraps + \code{\link[stringi]{stri_join}} which this function wraps } diff --git a/man/str_extract.Rd b/man/str_extract.Rd index 32d96d9d..d671f8b1 100644 --- a/man/str_extract.Rd +++ b/man/str_extract.Rd @@ -54,8 +54,8 @@ str_extract_all(shopping_list, "\\\\b[a-z]+\\\\b", simplify = TRUE) str_extract_all(shopping_list, "\\\\d", simplify = TRUE) } \seealso{ -\code{\link[stringi]{stri_extract_first}} and - \code{\link[stringi]{stri_extract_all}} for the underlying +\code{\link[stringi]{stri_extract}} and + \code{\link[stringi]{stri_extract}} for the underlying implementation. } From 338f31d693de338663f09af0c691e4306a72b84a Mon Sep 17 00:00:00 2001 From: gagolews Date: Mon, 8 Jun 2015 15:16:53 +0200 Subject: [PATCH 23/44] Update man and NEWS.md --- NEWS.md | 3 +++ R/extract.r | 3 +-- man/str_extract.Rd | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8417473a..06e70b0c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,9 @@ * The replacement to `perl()` is `regex()` not `regexp()` (#61). +* `str_subset()` now allows to set custom options for `fixed` + pattern search (#79). + # stringr 1.0.0 * stringr is now powered by [stringi](https://github.com/Rexamine/stringi) diff --git a/R/extract.r b/R/extract.r index b39d6260..df467d1d 100644 --- a/R/extract.r +++ b/R/extract.r @@ -4,8 +4,7 @@ #' #' @inheritParams str_detect #' @return A character vector. -#' @seealso \code{\link[stringi]{stri_extract}} and -#' \code{\link[stringi]{stri_extract}} for the underlying +#' @seealso \code{\link[stringi]{stri_extract}} for the underlying #' implementation. #' @param simplify If \code{FALSE}, the default, returns a list of character #' vectors. If \code{TRUE} returns a character matrix. diff --git a/man/str_extract.Rd b/man/str_extract.Rd index d671f8b1..ee29238a 100644 --- a/man/str_extract.Rd +++ b/man/str_extract.Rd @@ -54,8 +54,7 @@ str_extract_all(shopping_list, "\\\\b[a-z]+\\\\b", simplify = TRUE) str_extract_all(shopping_list, "\\\\d", simplify = TRUE) } \seealso{ -\code{\link[stringi]{stri_extract}} and - \code{\link[stringi]{stri_extract}} for the underlying +\code{\link[stringi]{stri_extract}} for the underlying implementation. } From e9353495aa33f596d2186b4ca2b87f6c1ee1be70 Mon Sep 17 00:00:00 2001 From: Stefan Milton Bache Date: Tue, 9 Jun 2015 19:45:09 +0200 Subject: [PATCH 24/44] Added test for hyphenation feature for string_interp and the case with no placeholders. --- tests/testthat/test-interp.r | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/testthat/test-interp.r b/tests/testthat/test-interp.r index 7b889fbf..51f13caa 100644 --- a/tests/testthat/test-interp.r +++ b/tests/testthat/test-interp.r @@ -38,3 +38,27 @@ test_that("str_interp works with nested expressions", { expect_that(s, is_identical_to("Works with } nested { braces too: 5348.00")) }) + +test_that("str_interp works in the absense of placeholders", { + + s <- str_interp("A quite static string here.") + + expect_that(s, is_identical_to("A quite static string here.")) + +}) + +test_that("str_interp allows for hyphenation to concatenate strings", { + + github_url <- "https://github.com/hadley/stringr" + issues <- "https://github.com/hadley/stringr/issues" + + s <- str_interp(~"You may find the development page at ${github_url} "- + "and file any issues at ${issues}.") + + expect_that(s, is_identical_to( + "You may find the development page at https://github.com/hadley/stringr and file any issues at https://github.com/hadley/stringr/issues.")) + +}) + + + From 70174ca8166193be7c174a59d1ee94ffb188c916 Mon Sep 17 00:00:00 2001 From: Stefan Milton Bache Date: Sat, 13 Jun 2015 12:34:06 +0200 Subject: [PATCH 25/44] Disallow nested placeholders for str_interp --- R/interp.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/interp.R b/R/interp.R index f2a4b9f7..bcb1c5c4 100644 --- a/R/interp.R +++ b/R/interp.R @@ -109,6 +109,11 @@ interp_placeholders <- function(string) start = starts, stop = c(starts[-1L] - 1L, nchar(string))) + # If there are nested placeholders, each part will not contain a full + # placeholder in which case we report invalid string interpolation template. + if (any(!grepl("\\$(\\[.*?\\])?\\{.+\\}", parts))) + stop("Invalid template string for interpolation.", call. = FALSE) + # For each part, find the opening and closing braces. opens <- lapply(strsplit(parts, ""), function(v) which(v == "{")) closes <- lapply(strsplit(parts, ""), function(v) which(v == "}")) From dee4e488983cba158f98c0f73f594765f4ee22c0 Mon Sep 17 00:00:00 2001 From: Stefan Milton Bache Date: Sat, 13 Jun 2015 12:44:37 +0200 Subject: [PATCH 26/44] added a few tests for str_interp --- R/interp.R | 4 +++- tests/testthat/test-interp.r | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/R/interp.R b/R/interp.R index bcb1c5c4..c5ee601f 100644 --- a/R/interp.R +++ b/R/interp.R @@ -176,7 +176,9 @@ eval_interp_matches <- function(matches, env) extract_expressions <- function(matches) { # Parse function for text argument as first argument. - parse_text <- function(text) parse(text = text) + parse_text <- function(text) + tryCatch(parse(text = text), + error = function(e) stop(conditionMessage(e), call. = FALSE)) # string representation of the expressions (without the possible formats). strings <- gsub("\\$(\\[.+?\\])?\\{", "", matches) diff --git a/tests/testthat/test-interp.r b/tests/testthat/test-interp.r index 51f13caa..ef87a199 100644 --- a/tests/testthat/test-interp.r +++ b/tests/testthat/test-interp.r @@ -61,4 +61,15 @@ test_that("str_interp allows for hyphenation to concatenate strings", { }) +test_that("str_interp fails when encountering nested placeholders", { + msg <- "This will never see the light of day" + num <- 1.2345 + + expect_error(str_interp("You cannot use nested placeholders, e.g. ${${msg}}"), + "Invalid template string for interpolation") + + expect_error(str_interp("Nor can you with formats, e.g. $[.2f]{${msg}}"), + "Invalid template string for interpolation") + +}) From f883c66f40721d77915d25c395ee2f12bba99d4b Mon Sep 17 00:00:00 2001 From: gagolews Date: Sat, 13 Jun 2015 15:29:57 +0200 Subject: [PATCH 27/44] add str_wrap tests --- tests/testthat/test-wrap.r | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/testthat/test-wrap.r diff --git a/tests/testthat/test-wrap.r b/tests/testthat/test-wrap.r new file mode 100644 index 00000000..d555d238 --- /dev/null +++ b/tests/testthat/test-wrap.r @@ -0,0 +1,7 @@ +context("Word-wrapping strings") + +test_that("wrapping removes spaces", { + expect_that(str_wrap(""), equals("")) + expect_that(str_wrap(" "), equals("")) + expect_that(str_wrap(" a "), equals("a")) +}) From 7e2cd8b5d86f73bf608e258c69e8ff225082f9bb Mon Sep 17 00:00:00 2001 From: gagolews Date: Sat, 13 Jun 2015 15:59:23 +0200 Subject: [PATCH 28/44] update travis.yml --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 17e1ba32..ab8c09b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,6 @@ language: r warnings_are_errors: true +sudo: required +r_github_packages: + - Rexamine/stringi + From f235fec359a8d95be6b2e506c9d45a6cfe1584c0 Mon Sep 17 00:00:00 2001 From: gagolews Date: Sat, 27 Jun 2015 14:10:15 +0200 Subject: [PATCH 29/44] #83: no fix_replacement for fixed patters --- NEWS.md | 3 +++ R/replace.r | 9 +++------ tests/testthat/test-replace.r | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 tests/testthat/test-replace.r diff --git a/NEWS.md b/NEWS.md index 06e70b0c..6191c6fd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,9 @@ * `str_subset()` now allows to set custom options for `fixed` pattern search (#79). + +* `str_replace()` now behaves correctly when a replacement string + contains `$`s (#83). # stringr 1.0.0 diff --git a/R/replace.r b/R/replace.r index fd3047c8..27365559 100644 --- a/R/replace.r +++ b/R/replace.r @@ -39,8 +39,6 @@ #' str_replace_all(str_c(fruits, collapse = "---"), #' c("one" = 1, "two" = 2, "three" = 3)) str_replace <- function(string, pattern, replacement) { - replacement <- fix_replacement(replacement) - switch(type(pattern), empty = , bound = stop("Not implemented", call. = FALSE), @@ -48,8 +46,8 @@ str_replace <- function(string, pattern, replacement) { opts_fixed = attr(pattern, "options")), coll = stri_replace_first_coll(string, pattern, replacement, opts_collator = attr(pattern, "options")), - regex = stri_replace_first_regex(string, pattern, replacement, - opts_regex = attr(pattern, "options")), + regex = stri_replace_first_regex(string, pattern, fix_replacement(replacement), + opts_regex = attr(pattern, "options")) ) } @@ -63,7 +61,6 @@ str_replace_all <- function(string, pattern, replacement) { } else { vec <- TRUE } - replacement <- fix_replacement(replacement) switch(type(pattern), empty = , @@ -72,7 +69,7 @@ str_replace_all <- function(string, pattern, replacement) { vectorize_all = vec, opts_fixed = attr(pattern, "options")), coll = stri_replace_all_coll(string, pattern, replacement, vectorize_all = vec, opts_collator = attr(pattern, "options")), - regex = stri_replace_all_regex(string, pattern, replacement, + regex = stri_replace_all_regex(string, pattern, fix_replacement(replacement), vectorize_all = vec, opts_regex = attr(pattern, "options")) ) } diff --git a/tests/testthat/test-replace.r b/tests/testthat/test-replace.r new file mode 100644 index 00000000..86a09a43 --- /dev/null +++ b/tests/testthat/test-replace.r @@ -0,0 +1,6 @@ +context("Replacements") + +test_that("replacement strings with $s work", { + expect_that(str_replace_all("abc$a$1$2", fixed("a"), "$1"), equals("$1bc$$1$1$2")) + expect_that(str_replace("abc$a$1$2", fixed("a"), "$1"), equals("$1bc$a$1$2")) +}) From 4c544ecd245127d7a343fec012b7b4dcf641f0b0 Mon Sep 17 00:00:00 2001 From: gagolews Date: Sat, 27 Jun 2015 14:44:08 +0200 Subject: [PATCH 30/44] #83 fixed: fix_replacement now generates correct replacement strings --- NEWS.md | 6 +++--- R/replace.r | 6 ++++-- tests/testthat/test-replace.r | 28 +++++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index 6191c6fd..927dff12 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,10 +3,10 @@ * The replacement to `perl()` is `regex()` not `regexp()` (#61). * `str_subset()` now allows to set custom options for `fixed` - pattern search (#79). + pattern search (#79, @gagolews). -* `str_replace()` now behaves correctly when a replacement string - contains `$`s (#83). +* `str_replace()` and `str_replace_all()` now behave correctly when a + replacement string contains `$`s, `\\\\1`, etc. (#83, @gagolews). # stringr 1.0.0 diff --git a/R/replace.r b/R/replace.r index 27365559..81862721 100644 --- a/R/replace.r +++ b/R/replace.r @@ -75,8 +75,10 @@ str_replace_all <- function(string, pattern, replacement) { } fix_replacement <- function(x) { - stri_replace_all_regex(x, c("\\$", "\\\\(\\d)"), c("\\\\$", "\\$$1"), - vectorize_all = FALSE) + stri_replace_all_regex( + stri_replace_all_fixed(x, "$", "\\$"), + "(? Date: Wed, 5 Aug 2015 15:23:53 -0500 Subject: [PATCH 31/44] make str_replace_na example show NA -> "NA" conversion --- R/replace.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/replace.r b/R/replace.r index 81862721..5714aac0 100644 --- a/R/replace.r +++ b/R/replace.r @@ -87,7 +87,7 @@ fix_replacement <- function(x) { #' @inheritParams str_replace #' @export #' @examples -#' str_replace_na(c("NA", "abc", "def")) +#' str_replace_na(c(NA, "abc", "def")) str_replace_na <- function(string, replacement = "NA") { stri_replace_na(string, replacement) } From 33f78324b8c3e50ea00e46677de848696ca2d37c Mon Sep 17 00:00:00 2001 From: hadley Date: Tue, 27 Oct 2015 11:00:56 -0500 Subject: [PATCH 32/44] str_view html widget --- DESCRIPTION | 4 +++- NAMESPACE | 1 + NEWS.md | 3 +++ R/view.R | 26 +++++++++++++++++++++++++ inst/htmlwidgets/lib/str_view.css | 11 +++++++++++ inst/htmlwidgets/str_view.js | 17 ++++++++++++++++ inst/htmlwidgets/str_view.yaml | 5 +++++ man/str_view.Rd | 32 +++++++++++++++++++++++++++++++ 8 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 R/view.R create mode 100644 inst/htmlwidgets/lib/str_view.css create mode 100644 inst/htmlwidgets/str_view.js create mode 100644 inst/htmlwidgets/str_view.yaml create mode 100644 man/str_view.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 7063c63e..ceebb339 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,9 @@ Imports: magrittr Suggests: testthat, - knitr + knitr, + htmltools, + htmlwidgets VignetteBuilder: knitr URL: https://github.com/hadley/stringr BugReports: https://github.com/hadley/stringr/issues diff --git a/NAMESPACE b/NAMESPACE index d423f856..e60e2d15 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -37,6 +37,7 @@ export(str_to_lower) export(str_to_title) export(str_to_upper) export(str_trim) +export(str_view) export(str_wrap) export(word) import(stringi) diff --git a/NEWS.md b/NEWS.md index 927dff12..ff92fc54 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # stringr 1.0.0.9000 +* `str_view()` creates an HTML widget to display regular expression + matches (#96). + * The replacement to `perl()` is `regex()` not `regexp()` (#61). * `str_subset()` now allows to set custom options for `fixed` diff --git a/R/view.R b/R/view.R new file mode 100644 index 00000000..6fcaea4c --- /dev/null +++ b/R/view.R @@ -0,0 +1,26 @@ +#' View HTML rendering of regular expression match. +#' +#' @inheritParams str_detect +#' @export +#' @examples +#' str_view(c("abc", "def", "fgh"), "[aeiou]") +#' str_view(c("abc", "def", "fgh"), "^") +str_view <- function(x, pattern) { + loc <- str_locate(x, pattern) + + # How to do escaping? Need to update x and loc + + has_match <- !is.na(loc[, "start"]) + str_sub(x[has_match], loc[has_match, , drop = FALSE]) <- + paste0("", str_sub(x[has_match], loc[has_match, , drop = FALSE]), "") + + bullets <- htmltools::HTML(str_c( + "
    \n", + str_c("
  • ", x, "
  • ", collapse = "\n"), + "\n
" + )) + + htmlwidgets::createWidget("str_view", list(html = bullets), + sizingPolicy = htmlwidgets::sizingPolicy(knitr.figure = FALSE, defaultHeight = NA), + package = "stringr") +} diff --git a/inst/htmlwidgets/lib/str_view.css b/inst/htmlwidgets/lib/str_view.css new file mode 100644 index 00000000..0cf22c7d --- /dev/null +++ b/inst/htmlwidgets/lib/str_view.css @@ -0,0 +1,11 @@ +.str_view ul, .str_view li { + list-style: none; + padding: 0; + margin: 0.5em 0; + font-family: monospace; +} + +.str_view .match { + border: 1px solid #ccc; + background-color: #eee; +} diff --git a/inst/htmlwidgets/str_view.js b/inst/htmlwidgets/str_view.js new file mode 100644 index 00000000..9e33abfa --- /dev/null +++ b/inst/htmlwidgets/str_view.js @@ -0,0 +1,17 @@ +HTMLWidgets.widget({ + + name: 'str_view', + + type: 'output', + + initialize: function(el, width, height) { + }, + + renderValue: function(el, x, instance) { + el.innerHTML = x.html; + }, + + resize: function(el, width, height, instance) { + } + +}); diff --git a/inst/htmlwidgets/str_view.yaml b/inst/htmlwidgets/str_view.yaml new file mode 100644 index 00000000..1fbf4980 --- /dev/null +++ b/inst/htmlwidgets/str_view.yaml @@ -0,0 +1,5 @@ +dependencies: + - name: str_view + version: 0.1.0 + src: htmlwidgets/lib/ + stylesheet: str_view.css diff --git a/man/str_view.Rd b/man/str_view.Rd new file mode 100644 index 00000000..704091fe --- /dev/null +++ b/man/str_view.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/view.R +\name{str_view} +\alias{str_view} +\title{View HTML rendering of regular expression match.} +\usage{ +str_view(x, pattern) +} +\arguments{ +\item{pattern}{Pattern to look for. + + The default interpretation is a regular expression, as described + in \link[stringi]{stringi-search-regex}. Control options with + \code{\link{regex}()}. + + Match a fixed string (i.e. by comparing only bytes), using + \code{\link{fixed}(x)}. This is fast, but approximate. Generally, + for matching human text, you'll want \code{\link{coll}(x)} which + respects character matching rules for the specified locale. + + Match character, word, line and sentence boundaries with + \code{\link{boundary}()}. An empty pattern, "", is equivalent to + \code{boundary("character")}.} +} +\description{ +View HTML rendering of regular expression match. +} +\examples{ +str_view(c("abc", "def", "fgh"), "[aeiou]") +str_view(c("abc", "def", "fgh"), "^") +} + From c0525f07a34bb34f4264906d8cc1ef97900fb965 Mon Sep 17 00:00:00 2001 From: hadley Date: Tue, 27 Oct 2015 11:02:40 -0500 Subject: [PATCH 33/44] Update docs --- man/str_replace_na.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/str_replace_na.Rd b/man/str_replace_na.Rd index c38248f0..05aa9040 100644 --- a/man/str_replace_na.Rd +++ b/man/str_replace_na.Rd @@ -23,6 +23,6 @@ coercible to one.} Turn NA into "NA" } \examples{ -str_replace_na(c("NA", "abc", "def")) +str_replace_na(c(NA, "abc", "def")) } From fb5cfa127ee1d6d4be7d5467b9ef3f664bd0c368 Mon Sep 17 00:00:00 2001 From: hadley Date: Tue, 27 Oct 2015 11:02:57 -0500 Subject: [PATCH 34/44] Correct arg name --- R/view.R | 10 +++++----- man/str_view.Rd | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/R/view.R b/R/view.R index 6fcaea4c..de21929d 100644 --- a/R/view.R +++ b/R/view.R @@ -5,18 +5,18 @@ #' @examples #' str_view(c("abc", "def", "fgh"), "[aeiou]") #' str_view(c("abc", "def", "fgh"), "^") -str_view <- function(x, pattern) { - loc <- str_locate(x, pattern) +str_view <- function(string, pattern) { + loc <- str_locate(string, pattern) # How to do escaping? Need to update x and loc has_match <- !is.na(loc[, "start"]) - str_sub(x[has_match], loc[has_match, , drop = FALSE]) <- - paste0("", str_sub(x[has_match], loc[has_match, , drop = FALSE]), "") + str_sub(string[has_match], loc[has_match, , drop = FALSE]) <- + paste0("", str_sub(string[has_match], loc[has_match, , drop = FALSE]), "") bullets <- htmltools::HTML(str_c( "
    \n", - str_c("
  • ", x, "
  • ", collapse = "\n"), + str_c("
  • ", string, "
  • ", collapse = "\n"), "\n
" )) diff --git a/man/str_view.Rd b/man/str_view.Rd index 704091fe..6057316b 100644 --- a/man/str_view.Rd +++ b/man/str_view.Rd @@ -4,9 +4,12 @@ \alias{str_view} \title{View HTML rendering of regular expression match.} \usage{ -str_view(x, pattern) +str_view(string, pattern) } \arguments{ +\item{string}{Input vector. Either a character vector, or something +coercible to one.} + \item{pattern}{Pattern to look for. The default interpretation is a regular expression, as described From d5c273d94a8d2e7119227704775913533aae176e Mon Sep 17 00:00:00 2001 From: hadley Date: Tue, 27 Oct 2015 17:18:12 -0500 Subject: [PATCH 35/44] Better way to set height --- R/view.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/view.R b/R/view.R index de21929d..300a1224 100644 --- a/R/view.R +++ b/R/view.R @@ -21,6 +21,9 @@ str_view <- function(string, pattern) { )) htmlwidgets::createWidget("str_view", list(html = bullets), - sizingPolicy = htmlwidgets::sizingPolicy(knitr.figure = FALSE, defaultHeight = NA), + sizingPolicy = htmlwidgets::sizingPolicy( + knitr.figure = FALSE, + defaultHeight = "auto" + ), package = "stringr") } From 6da35843bb36f4b7d74203503393592bf53e7f37 Mon Sep 17 00:00:00 2001 From: hadley Date: Thu, 29 Oct 2015 09:12:16 -0500 Subject: [PATCH 36/44] Upgrade roxygen2 --- DESCRIPTION | 1 + NAMESPACE | 2 +- man/case.Rd | 2 +- man/invert_match.Rd | 2 +- man/modifier-deprecated.Rd | 2 +- man/modifiers.Rd | 2 +- man/pipe.Rd | 2 +- man/str_c.Rd | 2 +- man/str_conv.Rd | 2 +- man/str_count.Rd | 2 +- man/str_detect.Rd | 2 +- man/str_dup.Rd | 2 +- man/str_extract.Rd | 2 +- man/str_interp.Rd | 3 ++- man/str_length.Rd | 2 +- man/str_locate.Rd | 2 +- man/str_match.Rd | 2 +- man/str_order.Rd | 2 +- man/str_pad.Rd | 2 +- man/str_replace.Rd | 4 ++-- man/str_replace_na.Rd | 2 +- man/str_split.Rd | 2 +- man/str_sub.Rd | 4 ++-- man/str_subset.Rd | 2 +- man/str_trim.Rd | 2 +- man/str_view.Rd | 2 +- man/str_wrap.Rd | 2 +- man/stringr.Rd | 2 +- man/word.Rd | 2 +- 29 files changed, 32 insertions(+), 30 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ceebb339..15d7c207 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,3 +24,4 @@ Suggests: VignetteBuilder: knitr URL: https://github.com/hadley/stringr BugReports: https://github.com/hadley/stringr/issues +RoxygenNote: 5.0.0 diff --git a/NAMESPACE b/NAMESPACE index e60e2d15..383bfd7a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2 (4.1.1): do not edit by hand +# Generated by roxygen2: do not edit by hand export("%>%") export("str_sub<-") diff --git a/man/case.Rd b/man/case.Rd index c5dbb117..d32a9d0a 100644 --- a/man/case.Rd +++ b/man/case.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/case.R \name{case} \alias{case} diff --git a/man/invert_match.Rd b/man/invert_match.Rd index b705ba0a..e2ec24ad 100644 --- a/man/invert_match.Rd +++ b/man/invert_match.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/locate.r \name{invert_match} \alias{invert_match} diff --git a/man/modifier-deprecated.Rd b/man/modifier-deprecated.Rd index 372b0ae6..0201ccd6 100644 --- a/man/modifier-deprecated.Rd +++ b/man/modifier-deprecated.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/modifiers.r \name{modifier-deprecated} \alias{ignore.case} diff --git a/man/modifiers.Rd b/man/modifiers.Rd index ecd7b1c2..1b27dd1f 100644 --- a/man/modifiers.Rd +++ b/man/modifiers.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/modifiers.r \name{modifiers} \alias{boundary} diff --git a/man/pipe.Rd b/man/pipe.Rd index 860620e6..e0bc9000 100644 --- a/man/pipe.Rd +++ b/man/pipe.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils.R \name{\%>\%} \alias{\%>\%} diff --git a/man/str_c.Rd b/man/str_c.Rd index fa81bdde..e344bd11 100644 --- a/man/str_c.Rd +++ b/man/str_c.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/c.r \name{str_c} \alias{str_c} diff --git a/man/str_conv.Rd b/man/str_conv.Rd index 68b574fa..5233e509 100644 --- a/man/str_conv.Rd +++ b/man/str_conv.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/conv.R \name{str_conv} \alias{str_conv} diff --git a/man/str_count.Rd b/man/str_count.Rd index 138569de..6d8f5745 100644 --- a/man/str_count.Rd +++ b/man/str_count.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/count.r \name{str_count} \alias{str_count} diff --git a/man/str_detect.Rd b/man/str_detect.Rd index 8d9f9562..fb9dfe2c 100644 --- a/man/str_detect.Rd +++ b/man/str_detect.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/detect.r \name{str_detect} \alias{str_detect} diff --git a/man/str_dup.Rd b/man/str_dup.Rd index c07e3d16..011824cb 100644 --- a/man/str_dup.Rd +++ b/man/str_dup.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dup.r \name{str_dup} \alias{str_dup} diff --git a/man/str_extract.Rd b/man/str_extract.Rd index ee29238a..977929da 100644 --- a/man/str_extract.Rd +++ b/man/str_extract.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/extract.r \name{str_extract} \alias{str_extract} diff --git a/man/str_interp.Rd b/man/str_interp.Rd index 2850a239..e0f6dce8 100644 --- a/man/str_interp.Rd +++ b/man/str_interp.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/interp.R \name{str_interp} \alias{str_interp} @@ -25,6 +25,7 @@ can be evaluated in the given environment, and \code{format} is a format specification valid for use with \code{\link{sprintf}}. } \examples{ + # Using values from the environment, and some formats user_name <- "smbache" amount <- 6.656 diff --git a/man/str_length.Rd b/man/str_length.Rd index e4b04f03..9df8a160 100644 --- a/man/str_length.Rd +++ b/man/str_length.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/length.r \name{str_length} \alias{str_length} diff --git a/man/str_locate.Rd b/man/str_locate.Rd index e68c5745..b6fc0701 100644 --- a/man/str_locate.Rd +++ b/man/str_locate.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/locate.r \name{str_locate} \alias{str_locate} diff --git a/man/str_match.Rd b/man/str_match.Rd index a3f16c74..56ac7d20 100644 --- a/man/str_match.Rd +++ b/man/str_match.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/match.r \name{str_match} \alias{str_match} diff --git a/man/str_order.Rd b/man/str_order.Rd index 64150843..991be0ff 100644 --- a/man/str_order.Rd +++ b/man/str_order.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sort.R \name{str_order} \alias{str_order} diff --git a/man/str_pad.Rd b/man/str_pad.Rd index 3af12fb2..848629ff 100644 --- a/man/str_pad.Rd +++ b/man/str_pad.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pad-trim.r \name{str_pad} \alias{str_pad} diff --git a/man/str_replace.Rd b/man/str_replace.Rd index 813b07eb..674d812c 100644 --- a/man/str_replace.Rd +++ b/man/str_replace.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/replace.r \name{str_replace} \alias{str_replace} @@ -13,7 +13,7 @@ str_replace_all(string, pattern, replacement) \item{string}{Input vector. Either a character vector, or something coercible to one.} -\item{pattern,replacement}{Supply separate pattern and replacement strings +\item{pattern, replacement}{Supply separate pattern and replacement strings to vectorise over the patterns. References of the form \code{\1}, \code{\2} will be replaced with the contents of the respective matched group (created by \code{()}) within the pattern. diff --git a/man/str_replace_na.Rd b/man/str_replace_na.Rd index 05aa9040..a4372fe4 100644 --- a/man/str_replace_na.Rd +++ b/man/str_replace_na.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/replace.r \name{str_replace_na} \alias{str_replace_na} diff --git a/man/str_split.Rd b/man/str_split.Rd index a66ae2ed..a6fd0dda 100644 --- a/man/str_split.Rd +++ b/man/str_split.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/split.r \name{str_split} \alias{str_split} diff --git a/man/str_sub.Rd b/man/str_sub.Rd index 73d70740..5a4852bb 100644 --- a/man/str_sub.Rd +++ b/man/str_sub.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sub.r \name{str_sub} \alias{str_sub} @@ -12,7 +12,7 @@ str_sub(string, start = 1L, end = -1L) <- value \arguments{ \item{string}{input character vector.} -\item{start,end}{Two integer vectors. \code{start} gives the position +\item{start, end}{Two integer vectors. \code{start} gives the position of the first character (defaults to first), \code{end} gives the position of the last (defaults to last character). Alternatively, pass a two-column matrix to \code{start}. diff --git a/man/str_subset.Rd b/man/str_subset.Rd index 94a4ee13..f0a255b6 100644 --- a/man/str_subset.Rd +++ b/man/str_subset.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/subset.R \name{str_subset} \alias{str_subset} diff --git a/man/str_trim.Rd b/man/str_trim.Rd index 6f15123a..ddd1eb85 100644 --- a/man/str_trim.Rd +++ b/man/str_trim.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pad-trim.r \name{str_trim} \alias{str_trim} diff --git a/man/str_view.Rd b/man/str_view.Rd index 6057316b..53ffa12f 100644 --- a/man/str_view.Rd +++ b/man/str_view.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/view.R \name{str_view} \alias{str_view} diff --git a/man/str_wrap.Rd b/man/str_wrap.Rd index 228419f6..345aeedf 100644 --- a/man/str_wrap.Rd +++ b/man/str_wrap.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/wrap.r \name{str_wrap} \alias{str_wrap} diff --git a/man/stringr.Rd b/man/stringr.Rd index 28f8280a..72151e24 100644 --- a/man/stringr.Rd +++ b/man/stringr.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/stringr.R \name{stringr} \alias{stringr} diff --git a/man/word.Rd b/man/word.Rd index cb444146..3e561057 100644 --- a/man/word.Rd +++ b/man/word.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.1): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/word.r \name{word} \alias{word} From 79e672868e8619f57568ec644452c04bb7e6b442 Mon Sep 17 00:00:00 2001 From: hadley Date: Thu, 29 Oct 2015 09:12:51 -0500 Subject: [PATCH 37/44] Add match argument to str_view --- R/view.R | 15 ++++++++++++++- man/str_view.Rd | 9 ++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/R/view.R b/R/view.R index 300a1224..34cd8a04 100644 --- a/R/view.R +++ b/R/view.R @@ -1,11 +1,24 @@ #' View HTML rendering of regular expression match. #' #' @inheritParams str_detect +#' @param match If \code{TRUE}, shows only strings that match the pattern. +#' If \code{FALSE}, shows only the strings that don't match the pattern. +#' Otherwise (the default) displays both matches and non-matches. #' @export #' @examples #' str_view(c("abc", "def", "fgh"), "[aeiou]") #' str_view(c("abc", "def", "fgh"), "^") -str_view <- function(string, pattern) { +#' +#' str_view(c("abc", "def", "fgh"), "d|e", match = TRUE) +#' str_view(c("abc", "def", "fgh"), "d|e", match = FALSE) +str_view <- function(string, pattern, match = NA) { + + if (identical(match, TRUE)) { + string <- string[str_detect(string, pattern)] + } else if (identical(match, FALSE)) { + string <- string[!str_detect(string, pattern)] + } + loc <- str_locate(string, pattern) # How to do escaping? Need to update x and loc diff --git a/man/str_view.Rd b/man/str_view.Rd index 53ffa12f..83773b1e 100644 --- a/man/str_view.Rd +++ b/man/str_view.Rd @@ -4,7 +4,7 @@ \alias{str_view} \title{View HTML rendering of regular expression match.} \usage{ -str_view(string, pattern) +str_view(string, pattern, match = NA) } \arguments{ \item{string}{Input vector. Either a character vector, or something @@ -24,6 +24,10 @@ coercible to one.} Match character, word, line and sentence boundaries with \code{\link{boundary}()}. An empty pattern, "", is equivalent to \code{boundary("character")}.} + +\item{match}{If \code{TRUE}, shows only strings that match the pattern. +If \code{FALSE}, shows only the strings that don't match the pattern. +Otherwise (the default) displays both matches and non-matches.} } \description{ View HTML rendering of regular expression match. @@ -31,5 +35,8 @@ View HTML rendering of regular expression match. \examples{ str_view(c("abc", "def", "fgh"), "[aeiou]") str_view(c("abc", "def", "fgh"), "^") + +str_view(c("abc", "def", "fgh"), "d|e", match = TRUE) +str_view(c("abc", "def", "fgh"), "d|e", match = FALSE) } From 44f1b9131110b432c3ceca5bcd27ed4855153d50 Mon Sep 17 00:00:00 2001 From: hadley Date: Fri, 30 Oct 2015 08:32:13 -0500 Subject: [PATCH 38/44] Use code coverage --- .travis.yml | 6 ++++++ README.md | 1 + 2 files changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index ab8c09b7..c6798e8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,12 @@ language: r warnings_are_errors: true sudo: required + r_github_packages: - Rexamine/stringi +r_packages: + - covr + +after_success: + - Rscript -e 'covr::codecov()' diff --git a/README.md b/README.md index 818d8a53..3583b27d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # stringr +[![Coverage Status](https://img.shields.io/codecov/c/github/hadley/stringr/master.svg)](https://codecov.io/github/hadley/stringr?branch=master) [![Build Status](https://travis-ci.org/hadley/stringr.png?branch=master)](https://travis-ci.org/hadley/stringr) Strings are not glamorous, high-profile components of R, but they do play a big role in many data cleaning and preparations tasks. R provides a solid set of string operations, but because they have grown organically over time, they can be inconsistent and a little hard to learn. Additionally, they lag behind the string operations in other programming languages, so that some things that are easy to do in languages like Ruby or Python are rather hard to do in R. From 5581d1f7fcf3f60e51f73069068859295be02e80 Mon Sep 17 00:00:00 2001 From: hadley Date: Fri, 30 Oct 2015 08:37:52 -0500 Subject: [PATCH 39/44] Add CRAN status badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3583b27d..6d3dfde5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # stringr -[![Coverage Status](https://img.shields.io/codecov/c/github/hadley/stringr/master.svg)](https://codecov.io/github/hadley/stringr?branch=master) [![Build Status](https://travis-ci.org/hadley/stringr.png?branch=master)](https://travis-ci.org/hadley/stringr) +[![Coverage Status](https://img.shields.io/codecov/c/github/hadley/stringr/master.svg)](https://codecov.io/github/hadley/stringr?branch=master) +[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/stringr)](http://cran.r-project.org/package=stringr) Strings are not glamorous, high-profile components of R, but they do play a big role in many data cleaning and preparations tasks. R provides a solid set of string operations, but because they have grown organically over time, they can be inconsistent and a little hard to learn. Additionally, they lag behind the string operations in other programming languages, so that some things that are easy to do in languages like Ruby or Python are rather hard to do in R. From 9ea8bd27c13fd1572cf6b7f90f3c8903fa502a08 Mon Sep 17 00:00:00 2001 From: hadley Date: Fri, 30 Oct 2015 08:40:06 -0500 Subject: [PATCH 40/44] Remove useless package docs. Closes #74 --- R/c.r | 1 + R/stringr.R | 5 ----- man/stringr.Rd | 9 --------- 3 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 R/stringr.R delete mode 100644 man/stringr.Rd diff --git a/R/c.r b/R/c.r index c33fa0eb..0f794d82 100644 --- a/R/c.r +++ b/R/c.r @@ -32,6 +32,7 @@ #' str_c(c("a", NA, "b"), "-d") #' # Use str_replace_NA to display literal NAs: #' str_c(str_replace_na(c("a", NA, "b")), "-d") +#' @import stringi str_c <- function(..., sep = "", collapse = NULL) { stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE) } diff --git a/R/stringr.R b/R/stringr.R deleted file mode 100644 index f0bef112..00000000 --- a/R/stringr.R +++ /dev/null @@ -1,5 +0,0 @@ -#' Fast and friendly string manipulation. -#' -#' @name stringr -#' @import stringi -NULL diff --git a/man/stringr.Rd b/man/stringr.Rd deleted file mode 100644 index 72151e24..00000000 --- a/man/stringr.Rd +++ /dev/null @@ -1,9 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/stringr.R -\name{stringr} -\alias{stringr} -\title{Fast and friendly string manipulation.} -\description{ -Fast and friendly string manipulation. -} - From adfe50898ec84230d80f7c8ec644c75ad30f5abc Mon Sep 17 00:00:00 2001 From: hadley Date: Fri, 30 Oct 2015 08:47:54 -0500 Subject: [PATCH 41/44] Better documentation for str_c. Fixes #98. Fixes #97. --- R/c.r | 9 ++++++++- man/str_c.Rd | 10 +++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/R/c.r b/R/c.r index 0f794d82..3cf01abb 100644 --- a/R/c.r +++ b/R/c.r @@ -9,7 +9,13 @@ #' the entire matrix collapsed to a single string. #' #' @param ... One or more character vectors. Zero length arguments -#' are removed. +#' are removed. Short arguments are recycled to the length of the +#' longest. +#' +#' Like most other R functions, missing values are "infectious": whenever +#' a missing value is combined with another string the result will always +#' be missing. Use \code{\link{str_replace_na}} to convert \code{NA} to +#' \code{"NA"} #' @param sep String to insert between input vectors. #' @param collapse Optional string used to combine input vectors into single #' string. @@ -39,6 +45,7 @@ str_c <- function(..., sep = "", collapse = NULL) { #' @export #' @rdname str_c +#' @usage NULL str_join <- function(..., sep = "", collapse = NULL) { .Deprecated("str_c") stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE) diff --git a/man/str_c.Rd b/man/str_c.Rd index e344bd11..a59757c6 100644 --- a/man/str_c.Rd +++ b/man/str_c.Rd @@ -6,12 +6,16 @@ \title{Join multiple strings into a single string.} \usage{ str_c(..., sep = "", collapse = NULL) - -str_join(..., sep = "", collapse = NULL) } \arguments{ \item{...}{One or more character vectors. Zero length arguments -are removed.} + are removed. Short arguments are recycled to the length of the + longest. + + Like most other R functions, missing values are "infectious": whenever + a missing value is combined with another string the result will always + be missing. Use \code{\link{str_replace_na}} to convert \code{NA} to + \code{"NA"}} \item{sep}{String to insert between input vectors.} From 42d513ec4eb1d6a953056df027e66cfaae3902c1 Mon Sep 17 00:00:00 2001 From: hadley Date: Fri, 30 Oct 2015 08:50:34 -0500 Subject: [PATCH 42/44] Cross-reference str_match from str_extract. Fixes #93 --- R/extract.r | 4 ++-- man/str_extract.Rd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/extract.r b/R/extract.r index df467d1d..12be5bbb 100644 --- a/R/extract.r +++ b/R/extract.r @@ -4,8 +4,8 @@ #' #' @inheritParams str_detect #' @return A character vector. -#' @seealso \code{\link[stringi]{stri_extract}} for the underlying -#' implementation. +#' @seealso \code{\link{str_match}} to extract matched groups; +#' \code{\link[stringi]{stri_extract}} for the underlying implementation. #' @param simplify If \code{FALSE}, the default, returns a list of character #' vectors. If \code{TRUE} returns a character matrix. #' @export diff --git a/man/str_extract.Rd b/man/str_extract.Rd index 977929da..f574e4d8 100644 --- a/man/str_extract.Rd +++ b/man/str_extract.Rd @@ -54,7 +54,7 @@ str_extract_all(shopping_list, "\\\\b[a-z]+\\\\b", simplify = TRUE) str_extract_all(shopping_list, "\\\\d", simplify = TRUE) } \seealso{ -\code{\link[stringi]{stri_extract}} for the underlying - implementation. +\code{\link{str_match}} to extract matched groups; + \code{\link[stringi]{stri_extract}} for the underlying implementation. } From 4180e2358c6686655f7cee1fc060c625606ffca4 Mon Sep 17 00:00:00 2001 From: hadley Date: Fri, 30 Oct 2015 08:55:45 -0500 Subject: [PATCH 43/44] Check that modifiers only applied to bare string. Fixes #60 --- NEWS.md | 3 +++ R/modifiers.r | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/NEWS.md b/NEWS.md index ff92fc54..d0c1cf00 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # stringr 1.0.0.9000 +* `fixed()`, `regex()`, and `coll()` now throw an error if you use them with + anything other than a plain string (#60). + * `str_view()` creates an HTML widget to display regular expression matches (#96). diff --git a/R/modifiers.r b/R/modifiers.r index 9807e3d2..fce7d8f8 100644 --- a/R/modifiers.r +++ b/R/modifiers.r @@ -45,6 +45,10 @@ NULL #' @export #' @rdname modifiers fixed <- function(pattern, ignore_case = FALSE) { + if (!is_bare_character(pattern)) { + stop("Can only modify plain character vectors.", call. = FALSE) + } + options <- stri_opts_fixed(case_insensitive = ignore_case) structure( @@ -63,6 +67,10 @@ fixed <- function(pattern, ignore_case = FALSE) { #' \code{\link[stringi]{stri_opts_regex}}, or #' \code{\link[stringi]{stri_opts_brkiter}} coll <- function(pattern, ignore_case = FALSE, locale = NULL, ...) { + if (!is_bare_character(pattern)) { + stop("Can only modify plain character vectors.", call. = FALSE) + } + options <- stri_opts_collator( strength = if (ignore_case) 2L else 3L, locale = locale, @@ -86,6 +94,10 @@ coll <- function(pattern, ignore_case = FALSE, locale = NULL, ...) { #' @param dotall If \code{TRUE}, \code{.} will also match line terminators. regex <- function(pattern, ignore_case = FALSE, multiline = FALSE, comments = FALSE, dotall = FALSE, ...) { + if (!is_bare_character(pattern)) { + stop("Can only modify plain character vectors.", call. = FALSE) + } + options <- stri_opts_regex( case_insensitive = ignore_case, multiline = multiline, @@ -153,3 +165,7 @@ perl <- function(pattern) { message("perl is deprecated. Please use regex() instead") regex(pattern) } + +is_bare_character <- function(x) { + is.character(x) && !is.object(x) +} From 84aba0d76e25a74153ee6a46787b56e3ade2b2cc Mon Sep 17 00:00:00 2001 From: Lincoln Mullen Date: Fri, 30 Oct 2015 15:30:34 -0400 Subject: [PATCH 44/44] Better handling of `skip_word_none` --- NEWS.md | 3 +++ R/modifiers.r | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index d0c1cf00..6da65950 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,9 @@ * `str_replace()` and `str_replace_all()` now behave correctly when a replacement string contains `$`s, `\\\\1`, etc. (#83, @gagolews). +* `boundary()` has a different default argument which works for splitting on + sentence boundaries (#58, @lmullen). + # stringr 1.0.0 * stringr is now powered by [stringi](https://github.com/Rexamine/stringi) diff --git a/R/modifiers.r b/R/modifiers.r index fce7d8f8..ce7648a4 100644 --- a/R/modifiers.r +++ b/R/modifiers.r @@ -115,14 +115,17 @@ regex <- function(pattern, ignore_case = FALSE, multiline = FALSE, #' @param type Boundary type to detect. #' @param skip_word_none Ignore "words" that don't contain any characters -#' or numbers - i.e. punctuation. +#' or numbers - i.e. punctuation. Default \code{NA} will skip such "words" +#' only when splitting on \code{word} boundaries. #' @export #' @rdname modifiers boundary <- function(type = c("character", "line_break", "sentence", "word"), - skip_word_none = TRUE, ...) { + skip_word_none = NA, ...) { type <- match.arg(type) - if (type != "word" & missingArg(skip_word_none)) skip_word_none <- FALSE + if (identical(skip_word_none, NA)) { + skip_word_none <- type == "word" + } options <- stri_opts_brkiter( type = type,