There are some things that I wish were easier with the 'stringr' or 'stringi' packages. The foremost of these is the extraction of numbers from strings. 'stringr' and 'stringi' make you figure out the regular expression for yourself; 'strex' takes care of this for you. There are many other handy functionalities in 'strex'. Contributions to this package are encouraged: it is intended as a miscellany of string manipulation functions that cannot be found in 'stringi' or 'stringr'.
There are some things that I wish were easier with the stringr
or
stringi
packages. The foremost of these is the extraction of numbers
from strings. stringr
lets you figure this out the regex for yourself;
strex
takes care of this for you. There are many more useful
functionalities in strex
. In particular, there’s a match_arg()
function which is more flexible than the base match.arg()
.
Contributions to this package are encouraged: it is intended as a
miscellany of string manipulation functions which cannot be found in
stringi
or stringr
.
You can install the release version of strex
from
CRAN with:
install.packages("strex")
You can install the development version of strex
from
GitHub with:
devtools::install_github("rorynolan/strex")
See the package website at https://rorynolan.github.io/strex.
strex
1.0.1strex
1.0.0str_split_by_nums()
has been renamed to str_split_by_numbers()
for consistency with str_extract_numbers()
.str_get_currencies()
has been renamed to str_extract_currencies()
and been greatly improved.str_get_currency()
has been replaced by str_nth_currency()
with siblings str_first_currency()
and str_last_currency()
.str_match_arg()
has been updated to behave more like base::match_arg()
.str_elems()
has been added. It is a vectorized version of str_elem()
.str_first_number()
more versatile than as.numeric()
since as.numeric("1,000")
returns NA
but str_first_number("1,000")
returns the number 1000.strex
0.1.3glue
.strex
0.1.2ore
.strex
0.1.1strex
0.1.0