Skip to content

stringx

Replacements for Base String Functions Powered by 'stringi'

v0.2.9 · Jan 11, 2025 · GPL (>= 2)

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

323

Last 30 days

12136th

833

Last 90 days

3K

Last year

Trend: +3.9% (30d vs prior 30d)

CRAN Check Status

1 ERROR
13 OK
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 (1 non-OK)
ERROR r-devel-macos-arm64

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)
  + 
  +     
...[truncated]...
        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 10, 2026
ERROR r-devel-macos-arm64

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
...[truncated]...
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

Dependency Network

Dependencies Reverse dependencies stringi stringx

Version History

new 0.2.9 Mar 10, 2026
updated 0.2.9 ← 0.2.8 diff Jan 10, 2025
updated 0.2.8 ← 0.2.6 diff Apr 8, 2024
updated 0.2.6 ← 0.2.5 diff Nov 29, 2023
updated 0.2.5 ← 0.2.4 diff May 20, 2023
updated 0.2.4 ← 0.2.3 diff Oct 26, 2022
updated 0.2.3 ← 0.2.2 diff Oct 12, 2022
updated 0.2.2 ← 0.1.3 diff Sep 2, 2021
updated 0.1.3 ← 0.1.2 diff Aug 4, 2021
new 0.1.2 Jul 27, 2021