extract_non_numerics(string, decimals = FALSE,
leading_decimals = decimals, negs = FALSE, sci = FALSE,
commas = FALSE)str_extract_non_numerics(string, decimals = FALSE,
leading_decimals = decimals, negs = FALSE, sci = FALSE,
commas = FALSE)
nth_non_numeric(string, n, decimals = FALSE,
leading_decimals = decimals, negs = FALSE, sci = FALSE,
commas = FALSE)
str_nth_non_numeric(string, n, decimals = FALSE,
leading_decimals = decimals, negs = FALSE, sci = FALSE,
commas = FALSE)
first_non_numeric(string, decimals = FALSE,
leading_decimals = decimals, negs = FALSE, sci = FALSE,
commas = FALSE)
str_first_non_numeric(string, decimals = FALSE,
leading_decimals = decimals, negs = FALSE, sci = FALSE,
commas = FALSE)
last_non_numeric(string, decimals = FALSE, leading_decimals = decimals,
negs = FALSE, sci = FALSE, commas = FALSE)
str_last_non_numeric(string, decimals = FALSE,
leading_decimals = decimals, negs = FALSE, sci = FALSE,
commas = FALSE)
A string.
Do you want to include the possibility of decimal numbers
(TRUE
) or not (FALSE
, the default).
Do you want to allow a leading decimal point to be the start of a number?
Do you want to allow negative numbers? Note that double negatives are not handled here (see the examples).
Make the search aware of scientific notation e.g. 2e3 is the same as 2000.
Allow comma separators in numbers (i.e. interpret 1,100 as a single number (one thousand one hundred) rather than two numbers (one and one hundred)).
A vector of integerish values. Must be either length 1 or
have length equal to the length of string
. Negative indices count from
the back: while n = 1
and n = 2
correspond to first and second, n = -1
and n = -2
correspond to last and second-last. n = 0
will return
NA
.