Articles by R on roryverse

Coping with varying `gcc` versions and capabilities in R packages

June 29, 2019 | R on roryverse

The problem I have a package called strex which is for string manipulation. In this package, I want to take advantage of the regex capabilities of C++11. The reason for this is that in strex, I find myself needing to do a calculation like
x <- list(c("1,000", "2,000,000"),
          c("1", "50", "3,455"))
lapply(x, function(x) as.numeric(stringr::str_replace_all(x, ",", "")))
#> [[1]]
#> [1] 1e+03 2e+06
#> 
#> [[2]]
#> [1]    1   50 3455
A lapply like this can ... [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)