RCall.jl icon indicating copy to clipboard operation
RCall.jl copied to clipboard

Passing DataFrame with large integer value in it throws cryptic error

Open davidanthoff opened this issue 8 years ago • 4 comments

Here is the repo:

using DataFrames, RCall

df = DataFrame(x=[2^63 - 1, 2])

R"$df"

davidanthoff avatar May 25 '16 22:05 davidanthoff

It is expected due to the limitation of integer size, R has a limitation of ~~2^32-1~~ 2^31-1. It also happens for plain julia integer RObject(2^63 - 1). For those large integer values, you should convert them to float numbers/float vectors.

randy3k avatar May 25 '16 22:05 randy3k

Ah, interesting! Maybe RCall could throw a better error message that points people in the right direction if this happens?

davidanthoff avatar May 26 '16 17:05 davidanthoff

Maybe we could define our own RConversionException?

simonbyrne avatar May 26 '16 18:05 simonbyrne

we need to first investigate the time/resources required for checking integer overflow or any other conversion validity.

However, making our own exceptions is not a bad idea.

randy3k avatar May 26 '16 23:05 randy3k