Skip to contents

roperators 1.4.0

New features

  • f() — string interpolation (“f-strings”): f("Hi {name}, you have {n} messages").
  • %else% — inline fallback for an expression that might error: read.csv(path) %else% data.frame().
  • %+-% — tolerance-interval constructor that composes with the between operators: x %><% (5 %+-% 0.5).
  • %/0% — safe division that returns NA instead of Inf/NaN on divide-by-zero.
  • %~% — case- and whitespace-insensitive string equality (the string counterpart to %~=%).
  • as.percent() — format a proportion as a percentage string.

Bug fixes

  • is.bad_for_calcs() now correctly flags Inf/-Inf as bad for calculations. Previously infinities slipped through, which also affected the comparison operators (%==%, %>=%, …) that rely on it.
  • is.R_x64() now calls is.os_unx() correctly (it previously referenced the function without calling it).
  • seq_around() now accepts ordinary numeric values for n; it previously errored unless n was given as an explicit integer (e.g. 5L).
  • The between operators (%><%, %>=<%) now handle reversed bounds, so 5 %><% c(10, 1) behaves the same as 5 %><% c(1, 10).
  • %na<-% now also accepts a replacement vector with one entry per missing value (filled in order), in addition to a scalar or a full-length vector.
  • Removed a stray duplicate (and subtly broken) internal definition of is.bad_for_calcs().

Improvements

Documentation, tests & infrastructure

  • Documentation overhaul for clarity and consistency: tightened every help page, fixed typos throughout, and added missing \value documentation and runnable examples.
  • %rlike% and %perl% now have their own help page (“SQL-style pattern matching”) instead of being grouped under the logical operators.
  • Rewritten, comprehensive vignette and a README.Rmd so the README’s output is always real.
  • Added a full testthat test suite covering the operators and helpers, a BugReports URL, a pkgdown site configuration, and GitHub Actions for R-CMD-check and pkgdown deployment.

roperators 1.3.14

CRAN release: 2023-07-20

  • added is.os_arm() to check if running ARM cpu
  • added get_R_version() to pull current R version
  • added get_R_version_age() to find how old the installed R version is
  • added get_latest_CRAN_version() to find the latest version on CRAN (rvest required)
  • added get_system_python() to return default python called in system calls to “python”
  • added %C% for choose operator and %P% for permute
  • added %integrate% for inline integrations
  • added is.http_available() to check whether you can send an HTTP request (via httr, RCurl, or a system call to curl).

roperators 1.3.0