Learn R Programming

taRifx (version 1.0.6.2)

destring: Convert character vector to numeric, ignoring irrelevant characters.

Description

Convert character vector to numeric, ignoring irrelevant characters.

Usage

destring(x, keep = "0-9.-")

Arguments

x

A vector to be operated on

keep

Characters to keep in, in bracket regular expression form. Typically includes 0-9 as well as the decimal separator (. in the US and , in Europe).

Value

vector of type numeric

Examples

Run this code
# NOT RUN {
test <- "50,762.83a"
destring(test)
# }

Run the code above in your browser using DataLab