# NOT RUN {
extract_numbers(c("abc123abc456", "abc1.23abc456"))
extract_numbers(c("abc1.23abc456", "abc1..23abc456"), decimals = TRUE)
extract_numbers("abc1..23abc456", decimals = TRUE)
extract_numbers("abc1..23abc456", decimals = TRUE, leading_decimals = TRUE)
extract_numbers("abc1..23abc456", decimals = TRUE, leading_decimals = TRUE,
leave_as_string = TRUE)
extract_numbers("-123abc456")
extract_numbers("-123abc456", negs = TRUE)
extract_numbers("--123abc456", negs = TRUE)
extract_non_numerics("abc123abc456")
extract_non_numerics("abc1.23abc456")
extract_non_numerics("abc1.23abc456", decimals = TRUE)
extract_non_numerics("abc1..23abc456", decimals = TRUE)
extract_non_numerics("abc1..23abc456", decimals = TRUE,
leading_decimals = TRUE)
extract_non_numerics(c("-123abc456", "ab1c"))
extract_non_numerics("-123abc456", negs = TRUE)
extract_non_numerics("--123abc456", negs = TRUE)
extract_numbers(c(rep("abc1.2.3", 2), "a1b2.2.3", "e5r6"), decimals = TRUE)
extract_numbers("ab.1.2", decimals = TRUE, leading_decimals = TRUE)
nth_number("abc1.23abc456", 2)
nth_number("abc1.23abc456", 2, decimals = TRUE)
nth_number("-123abc456", -2, negs = TRUE)
extract_non_numerics("--123abc456", negs = TRUE)
nth_non_numeric("--123abc456", 1)
nth_non_numeric("--123abc456", -2)
# }
Run the code above in your browser using DataCamp Workspace