as.integer.or.dbl: as.integer.or.dbl

View source: R/utils.R

as.integer.or.dblR Documentation

as.integer.or.dbl

Description

This function checks if any value in a vector is above 2e+09, and if so runs round(as.double()) on it. If not it uses as.integer() instead. This is to get around the 32-bit limitation in R that integers cannot be larger than around 2e+09, in which case as.integer would return an NA.

Usage

## S3 method for class 'or.dbl'
as.integer(x)

Arguments

x

vector to be coerced to integers or doubles

Value

a vector of integers or doubles


ices-tools-dev/icesRDBES documentation built on April 17, 2025, 1:58 p.m.