Closed phaverty closed 6 years ago
@phaverty
Note that when converting e.g. from double to integer, for missing values you get: nan -> -2147483648.
So, you'll get a warning even if there is no actual loss of precision.
You could replace nv[i] != res[i]
by res[i] != nv[i] && res[i] != NA_INTEGER
to overcome this problem (I think without significant loss in performance).
Uses an Rcpp function from Florian Prive to convert an incoming matrix to integer type, checking to see if any values are unexpectedly changed. Speeds up writing big integer matrices by 5X and fixes #84