Learn R Programming

mmstat4 (version 0.2.0)

toNum: toNum

Description

Converts x to a numeric. If the conversion fails or the value is outside min and max then NA is returned

Usage

toNum(x, min = -Inf, max = +Inf)

Value

a single integer value

Arguments

x

input object

min

numeric: minimal value

max

numeric: maximal value

Examples

Run this code
toNum(3.0)
toNum("3.0")
toNum("test")

Run the code above in your browser using DataLab