strings <- c(
"abc123def456", "abc-0.12def.345", "abc.12e4def34.5e9",
"abc1,100def1,230.5", "abc1,100e3,215def4e1,000"
)
str_nth_non_numeric(strings, n = 2)
str_nth_non_numeric(strings, n = -2, decimals = TRUE)
str_first_non_numeric(strings, decimals = TRUE, leading_decimals = FALSE)
str_last_non_numeric(strings, big_mark = ",")
str_nth_non_numeric(strings,
n = 1, decimals = TRUE, leading_decimals = TRUE,
sci = TRUE
)
str_first_non_numeric(strings,
decimals = TRUE, leading_decimals = TRUE,
sci = TRUE, big_mark = ",", negs = TRUE
)
str_first_non_numeric(c("22", "1.2.3"), decimals = TRUE)
Run the code above in your browser using DataLab