extract_num: Extract number

View source: R/dataWranglingCleaning.R

extract_numR Documentation

Extract number

Description

Extracts number (positive or negative) from a string and converts it to numerical. If two number in the same string, then it will return the numbers combined

Usage

extract_num(x)

Arguments

x

a (vector) string

Value

Numeric

Examples

extract_num("I am 22 years old")
extract_num(c("I am -22 years old", "-74 and 80"))

matschmitz/schmitz documentation built on July 9, 2024, 8:25 a.m.