| asInteger {checkmate} | R Documentation |
asInteger is intended to be used for vectors while asInt is
a specialization for scalar integers and asCount for scalar
non-negative integers.
Convertible are (a) atomic vectors with all elements NA
and (b) double vectors with all elements being within tol
range of an integer.
asInteger(x, ..., tol = sqrt(.Machine$double.eps), .var.name) asCount(x, na.ok = FALSE, positive = FALSE, tol = sqrt(.Machine$double.eps), .var.name) asInt(x, na.ok = FALSE, lower = -Inf, upper = Inf, tol = sqrt(.Machine$double.eps), .var.name)
x |
[any] |
... |
[any] |
tol |
[ |
.var.name |
[character(1)] |
na.ok |
[ |
positive |
[ |
lower |
[ |
upper |
[ |
Converted x.
asInteger(c(1, 2, 3)) asCount(1) asInt(1)