asInteger is intended to be used for vectors while asInt isa specialization for scalar integers and asCount for scalarnon-negative integers.Convertible are (a) atomic vectors with all elements NAand (b) double vectors with all elements being within tolrange of an integer.
You are watching: A numeric or double convertible argument is expected
Note that these functions may be deprecated in the future.Instead, it is advised to use assertCount,assertInt or assertIntegerish withargument coerce set to TRUE instead.
asInteger( x, tol = sqrt(.Machine$double.eps), lower = -Inf, upper = Inf, any.missing = TRUE, all.missing = TRUE, len = NULL, min.len = NULL, max.len = NULL, unique = FALSE, sorted = FALSE, names = NULL, .var.name = vname(x))asCount( x, na.ok = FALSE, positive = FALSE, tol = sqrt(.Machine$double.eps), .var.name = vname(x))asInt( x, na.ok = FALSE, lower = -Inf, upper = Inf, tol = sqrt(.Machine$double.eps), .var.name = vname(x))
Arguments
Value
Converted x.
See more: Azio Backlit Mechanical Gaming Keyboard (Mgk1-K), Azio Rgb Backlit Mechanical Gaming Keyboard (Mgk1
Details
This function does not distinguish betweenNA, NA_integer_, NA_real_, NA_complex_NA_character_ and NaN.
Examples
asInteger(c(1, 2, 3))#> <1> 1 2 3asCount(1)#> <1> 1asInt(1)#> <1> 1