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 May 15, 2022, 4:15 p.m.