-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.Rmd
45 lines (32 loc) · 2.4 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
output: github_document
---
<!-- index.md is generated from index.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# strex <img src="man/figures/logo.png" align="right" height=140/>
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` makes you figure 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`.
The github repo of `strex` is at https://github.com/rorynolan/strex.
## Installation
You can install the release version of `strex` from [CRAN](https://CRAN.R-project.org) with:
```{r, eval=FALSE}
install.packages("strex")
```
You can install the development version of `strex` from [GitHub](https://github.com/rorynolan/strex/) with:
```{r, eval=FALSE}
devtools::install_github("rorynolan/strex")
```
## How to use the package
The following articles contain all you need to get going:
* [Alphordering Numbers](https://rorynolan.github.io/strex/articles/alphordering-numbers.html) tells you how to fix the pesky problem of numbers in file names not complying with alphabetical order.
* [Argument Matching](https://rorynolan.github.io/strex/articles/argument-matching.html) showcases `strex::match_arg()`, an improvement on `base::match.arg()` which allows one to ignore case during argument matching.
* [Before and After](https://rorynolan.github.io/strex/articles/before-and-after.html) is for the common problem where you want to get the bit of a string before or after an occurrence of a pattern.
* [Numbers Within Strings](https://rorynolan.github.io/strex/articles/numbers-in-strings.html) shows how to deal with the common problem of extracting numeric information contained within larger strings.
* [And/Or Detection](https://rorynolan.github.io/strex/articles/detection.html) showcases `str_detect_all()` and `str_detect_any()`.
* [Important Miscellany](https://rorynolan.github.io/strex/articles/important-miscellany.html) is the rest, and there's a lot.