TimTaylor/ageutils

feature: character age intervals to bounds function

Opened this issue · 0 comments

e.g.

tmp <- c("[0, 1)", "[10, 15)", "[2, 9)")

strcapture(
    pattern = "([[:digit:]]+),[[:space:]]*([[:digit:]]+)",
    x = tmp,
    proto = data.frame(lower=integer(),upper=integer()),
    perl = TRUE
)
#>   lower upper
#> 1     0     1
#> 2    10    15
#> 3     2     9

Created on 2022-11-02 with reprex v2.0.2