stringx
Replacements for Base String Functions Powered by 'stringi'
Description
English is the native language for only 5% of the World population. Also, only 17% of us can understand this text. Moreover, the Latin alphabet is the main one for merely 36% of the total. The early computer era, now a very long time ago, was dominated by the US. Due to the proliferation of the internet, smartphones, social media, and other technologies and communication platforms, this is no longer the case. This package replaces base R string functions (such as grep(), tolower(), sprintf(), and strptime()) with ones that fully support the Unicode standards related to natural language and date-time processing. It also fixes some long-standing inconsistencies, and introduces some new, useful features. Thanks to 'ICU' (International Components for Unicode) and 'stringi', they are fast, reliable, and portable across different platforms.
Downloads
307
Last 30 days
10284th
307
Last 90 days
307
Last year
CRAN Check Status
Show all 14 flavors
| Flavor | Status |
|---|---|
| r-devel-linux-x86_64-debian-clang | OK |
| r-devel-linux-x86_64-debian-gcc | OK |
| r-devel-linux-x86_64-fedora-clang | OK |
| r-devel-linux-x86_64-fedora-gcc | OK |
| r-devel-macos-arm64 | ERROR |
| r-devel-windows-x86_64 | OK |
| r-oldrel-macos-arm64 | OK |
| r-oldrel-macos-x86_64 | OK |
| r-oldrel-windows-x86_64 | OK |
| r-patched-linux-x86_64 | OK |
| r-release-linux-x86_64 | OK |
| r-release-macos-arm64 | OK |
| r-release-macos-x86_64 | OK |
| r-release-windows-x86_64 | OK |
Check details (14 non-OK)
*
*
*
*
tests
Running ‘realtest.R’ [1s/1s]
Running the tests in ‘tests/realtest.R’ failed.
Complete output:
> # This file is part of the 'stringx' project.
> # Copyleft (c) 2021-2025, Marek Gagolewski <https://www.gagolewski.com>
>
> # Runs all unit tests for the package
>
> this_package <- "stringx"
>
> set.seed(123)
> library(this_package, character.only=TRUE)
Attaching package: 'stringx'
The following objects are masked from 'package:base':
casefold, chartr, endsWith, gregexec, gregexpr, grep, grepl, gsub,
ISOdate, ISOdatetime, nchar, nzchar, paste, paste0, regexec,
regexpr, sprintf, startsWith, strftime, strptime, strrep, strsplit,
strtrim, strwrap, sub, substr, substr<-, substring, substring<-,
Sys.time, tolower, toupper, trimws, xtfrm, xtfrm.default
> if (require("realtest", quietly=TRUE)) {
+ f <- file.path(path.package(this_package), "realtest")
+ r <- test_dir(f, ".*\\.R$")
+ x <- summary(r)
+
+ names(r) <- row.names(x)
+ fails <- x[x[["match"]] == "fail", , drop=FALSE]
+ if (nrow(fails) > 0) {
+ fails2 <- as.data.frame(fails[,
+ !(names(fails) %in% ".expr") & !sapply(fails, function(x) all(is.na(x))),
+ drop=FALSE])
+ for (i in row.names(fails2)) {
+ cat(sprintf("%s:%d:\n", fails2[i, ".file"], fails2[i, ".line"]))
+ cat(" value: "); str(r[[i]][["object"]][["value"]], indent.str=" ")
+ cat(" sides: "); str(r[[i]][["object"]][["sides"]], indent.str=" ")
+ }
+
+ if (require("stringi", quietly=TRUE))
+ cat(sprintf("%s; %s\n", stri_info(TRUE), Sys.getlocale()))
+
+ stop("some tests failed")
+ }
+ }
/Volumes/Builds/packages/sonoma-arm64/results/4.6/stringx.Rcheck/stringx/realtest/strptime-all.R:89:
value: chr "--T::+1200"
sides: NULL
stringi_1.8.7 (en_US.UTF-8; ICU4C 71.1 [system#U_CHARSET_IS_UTF8]; Unicode 14.0); C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
Error: some tests failed
Execution halted
*
*
*
*
*
*
*
*
*
Check History
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 9, 2026
tests
Running ‘realtest.R’ [1s/1s]
Running the tests in ‘tests/realtest.R’ failed.
Complete output:
> # This file is part of the 'stringx' project.
> # Copyleft (c) 2021-2025, Marek Gagolewski <https://www.gagolewski.com>
>
> # Runs all unit tests for the package
>
> this_package <- "stringx"
>
> set.seed(123)
> library(this_package, character.only=TRUE)
Attaching package: 'stringx'
The following objects are masked from 'package:base':
casefold, chartr, endsWi