Learn R Programming

mmstat4 (version 0.2.0)

toInt: toInt

Description

Converts x to an integer. If the conversion fails or the integer is outside min and max then NA_integer_ is returned

Usage

toInt(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
toInt(3.0)
toInt("3.0")
toInt("test")

Run the code above in your browser using DataLab