Skip to content

Commit e852092

Browse files
authored
Fix author's email in DESCRIPTION (#19)
* Fix author's email in DESCRIPTION Updated author's email address in DESCRIPTION file. * prep for fix * final cran comments * addressing errors in downstream BeeBDC package * fixed spelling error in NEWS
1 parent 095fd3e commit e852092

10 files changed

Lines changed: 37 additions & 8 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ Type: Package
33
Title: Safe, Multiple, Simultaneous String Substitution
44
Version: 2.0.0
55
Authors@R: c(
6-
person("Mark", "Ewing", email="b.mark@ewingsonline.com", role=c("aut","cre"))
6+
person("Mark", "Ewing", email="b.mark.ewing@gmail.com", role=c("aut","cre"))
77
)
88
BugReports: https://github.com/bmewing/mgsub/issues
99
Description: Designed to enable simultaneous substitution in strings in a safe fashion.
1010
Safe means it does not rely on placeholders (which can cause errors in same length matches).
1111
License: MIT + file LICENSE
1212
Encoding: UTF-8
1313
ByteCompile: true
14-
RoxygenNote: 7.3.3
1514
Suggests: testthat,
1615
knitr,
1716
rmarkdown
1817
VignetteBuilder: knitr
1918
URL: https://github.com/bmewing/mgsub, https://bmewing.github.io/mgsub/
19+
Config/roxygen2/version: 8.0.0

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Rewrote key functions in C to provide significant performance boost (4-5x speedup in certain tests)
33
* `get_matches` and `filter_overlap` are the primary performance enhancers
44
* `get_matches_base` and `filter_overlap_base` retain the original base R functionality in case of issues with building the code
5+
* Changed maintainer email address because current one was bouncing CRAN emails
56

67
# mgsub 1.7.3
78
* Vignettes were using the qdap package which was not available causing errors. This update only modifies the vignette to remove the use of qdap (and microbenchmark) and so these were removed from the 'suggests'.
@@ -17,7 +18,7 @@
1718
# mgsub 1.7
1819

1920
* Added the mgsub_censor function which enables fast, simultaneous censoring of patterns
20-
* Trimmed unncessary logic and helper functions
21+
* Trimmed unnecessary logic and helper functions
2122

2223
# mgsub 1.6
2324

R/helper_functions.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ collect_matches = function(string, pattern, ...) {
5555
if (length(pattern) == 0) {
5656
return(collect_matches_base(string, pattern, ...))
5757
}
58+
59+
if (any(is.numeric(pattern))) {
60+
pattern[is.numeric(pattern)] = as.character(pattern[is.numeric(pattern)])
61+
}
5862

5963
if (has_collect_matches_native()) {
6064
return(.Call("_mgsub_collect_matches_cpp", string, pattern, list(...),

R/mgsub.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ mgsub = function(string, pattern, replacement, recycle=FALSE, ...) {
2626

2727
if (all(is.na(string))) return(string)
2828
sna = !is.na(string)
29+
sn = is.numeric(string)
2930
if (!is.logical(recycle)) stop("Recycle must be a boolean")
3031
if (!recycle & length(pattern) != length(replacement)) {
3132
stop("pattern and replacement vectors must be the same length")
@@ -40,6 +41,7 @@ mgsub = function(string, pattern, replacement, recycle=FALSE, ...) {
4041
lr = length(replacement)
4142
replacement = rep(replacement, ceiling(lp / lr))[seq_along(pattern)]
4243
}
44+
4345
result = vapply(X = string[sna],
4446
FUN = worker,
4547
FUN.VALUE = c(""),

cran-comments.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
## Test environments
2-
* local Windows install, R 4.5.0
3-
* Windows Server 2025 (via Github Actions), R 4.5.3
4-
* MacOS 15.7.4 (via Github Actions), R 4.5.3
2+
* local Windows install, R 4.6.0
3+
* Windows Server 2025 (via Github Actions), R 4.6.0
4+
* MacOS 15.7.4 (via Github Actions), R 4.6.0
5+
* ubuntu 24.04.4 LTS (via Github Actions), R 4.6.0
56
* ubuntu 24.04.4 LTS (via Github Actions), R 4.5.3
6-
* ubuntu 24.04.4 LTS (via Github Actions), R 4.4.3
77
* ubuntu 24.04.4 LTS (via Github Actions), R-devel
88

99
## R CMD check results
1010
There were no ERRORs or WARNINGs.
11+
12+
## Updating maintainer email (this is the NOTE in my check)
13+
I was informed by a maintainer of a downstream package that mgsub
14+
was set to be delisted because CRAN emails were bouncing. I have
15+
been having sporadic issues with my ewingsonline.com domain and
16+
so switched to `b.mark.ewing@gmail.com` in order to address this.

man/mgsub-package.Rd

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/get_matches.o

-1.36 KB
Binary file not shown.

src/mgsub.dll

2 KB
Binary file not shown.

src/resolve_matches.o

-1.33 KB
Binary file not shown.

tests/testthat/test_mgsub.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ test_that("NAs are correctly handled", {
3636
expect_equal(mgsub(c("string", NA, "test"), c("t"), c("p")), c("spring", NA, "pesp"))
3737
})
3838

39+
test_that("numeric input is handled gracefully", {
40+
expect_equal(mgsub("I live in the 37664 zip code but I'm moving to 99516",
41+
pattern = 37664, replacement=37660),
42+
"I live in the 37660 zip code but I'm moving to 99516")
43+
expect_equal(mgsub("I live in the 37664 zip code but I'm moving to 99516",
44+
pattern = c(37664, "99516"), replacement=c("37660", 58126)),
45+
"I live in the 37660 zip code but I'm moving to 58126")
46+
expect_equal(mgsub(123414, 4, "a"), "123a1a")
47+
})
48+
3949
test_that("recylce has to be a boolean", {
4050
expect_error(mgsub("hey, ho", c("hey"), c("ho", "hey"), recycle = "yes"))
4151
expect_error(mgsub("hey, ho", c("hey"), c("ho", "hey"), recycle = 1))

0 commit comments

Comments
 (0)