R/compress-storage-modes.R

Defines functions compress.storage.mode compress.storage.mode.default compress.storage.mode.double

compress.storage.mode <- function(x) UseMethod("compress.storage.mode")
compress.storage.mode.default <- function(x) x
compress.storage.mode.double <- function(x){
  ok <- is.finite(x)
  #y <- as.integer(x)
  if(max(abs(x[ok]))>.Machine$integer.max || any (x[ok]!=trunc(x[ok]))) x else as.integer(x)
}

Try the memisc package in your browser

Any scripts or data that you put into this service are public.

memisc documentation built on May 2, 2019, 5:45 p.m.