Learn R Programming

Smisc (version 0.3.9.1)

as.numericSilent: Convert any vector to numeric, if possible

Description

Convert any vector to numeric, if possible

Usage

as.numericSilent(x)

Arguments

x

vector of any type

Value

If as.numeric(x) produces an error or warning, x is returned unchanged. Otherwise, as.numeric(x) is returned.

See Also

as.numeric

Examples

Run this code
# NOT RUN {
as.numericSilent(c("this","that"))
as.numericSilent(c("2893.9","9423.48"))
as.numericSilent(c("392.1", "that"))
# }

Run the code above in your browser using DataLab