strex v1.2.0

0

Monthly downloads

0th

Percentile

Extra String Manipulation Functions

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'.

Readme

strex

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.

Travis-CI Build
Status AppVeyor build
status Coverage
status

Project Status: Active – The project has reached a stable, usable
state and is being actively
developed. lifecycle

CRAN
status RStudio CRAN
downloads RStudio
CRAN monthly downloads Rdocumentation

Installation

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")

How to use the package

See the package website at https://rorynolan.github.io/strex.

Contribution

The preferred method of contribution is by GitHub pull request.

Please note that the strex project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Functions in strex

Name Description
str_extract_non_numerics Extract non-numbers from a string.
before-and-after Extract text before or after nth occurrence of pattern.
currency Extract currency amounts from a string.
str_elem Extract a single character from a string, using its index.
str_alphord_nums Make string numbers comply with alphabetical order.
str_can_be_numeric Check if a string could be considered as numeric.
str_elems Extract several single elements from a string.
str_extract_numbers Extract numbers from a string.
str_before_last_dot Extract the part of a string before the last period.
str_nth_number_before_mth Find the nth number before the mth occurrence of a pattern.
str_give_ext Ensure a file name has the intended extension.
str_remove_quoted Remove the quoted parts of a string.
str_paste_elems Extract single elements of a string and paste them together.
str_split_camel_case Split a string based on CamelCase.
str_split_by_numbers Split a string by its numeric characters.
str_match_arg Argument Matching.
str_singleize Remove back-to-back duplicates of a pattern in a string.
str_locate_braces Locate the braces in a string.
str_nth_number Extract the nth number from a string.
str_nth_number_after_mth Find the nth number after the mth occurrence of a pattern.
str_locate_nth Locate the indices of the nth instance of a pattern.
str_to_vec Convert a string to a vector of characters
str_nth_non_numeric Extract the nth non-numeric substring from a string.
strex strex: extra string manipulation functions
str_trim_anything Trim something other than whitespace
No Results!

Vignettes of strex

Name
alphordering-numbers.Rmd
argument-matching.Rmd
before-and-after.Rmd
important-miscellany.Rmd
numbers-in-strings.Rmd
No Results!

Last month downloads

Details

License GPL-3
URL https://rorynolan.github.io/strex, https://github.com/rorynolan/strex
BugReports https://github.com/rorynolan/strex/issues
LinkingTo Rcpp (>= 1.0.1)
VignetteBuilder knitr
Biarch TRUE
Encoding UTF-8
Language en-US
LazyData true
RoxygenNote 6.1.1
SystemRequirements C++11
NeedsCompilation yes
Packaged 2019-09-12 14:47:17 UTC; rnolan
Repository CRAN
Date/Publication 2019-09-13 04:50:02 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/strex)](http://www.rdocumentation.org/packages/strex)