[Rcpp-devel] trying installing RcppCNPy with -std=c++11 (or c++0x) and failed due to incompatible number of arguments

Gong-Yi Liao gongyi.liao at gmail.com
Wed Feb 20 17:07:39 CET 2013


I have build the updated RppCNPy package (0.2.0.1) and load it in R 
3.0.0 (which supports long double and may be long long int) and R 2.15.2 
, npyLoad now can load data without the 'BigEndian' problem but with 
another even weirder problem:

## Case 1:
=== In Python =====
[1]: save('test.npy', pylab.poisson(lam=5.6, size=10))

== In R 3.0.0. ======
R> npyLoad('test.npy')
  [1] 1.976262583e-323 1.482196938e-323 1.482196938e-323 
9.881312917e-324  0.000000000e+00 1.482196938e-323 4.940656458e-324 
2.964393875e-323 1.482196938e-323

## Case 2:
=== In Python =========
In [12]: save('test.npy', [numpy.int(x) for x in poisson(3.5, 10)])

== In R 3.0.0 ==========
R> npyLoad('test.npy')
  [1] 9.881312917e-324 1.976262583e-323 2.470328229e-323 
1.482196938e-323 3.458459521e-323 1.482196938e-323 9.881312917e-324 
2.964393875e-323 1.976262583e-323
[10] 9.881312917e-324

Case 3:
== In Python ========
In [13]: save('test.npy', [double(x) for x in poisson(3.5, 10)])

== In R ===========
R> npyLoad('test.npy')
  [1] 4 8 4 4 5 2 3 5 5 3

It seems that something needs to be modified in R that we can load some 
int64 type data. I am not sure if the orphaned 'int64' package can help, 
because in the first case, I have tested:

R> as.int64(npyLoad('test.npy')[1])
[1] 0

Gong.







On 02/19/2013 08:15 PM, Dirk Eddelbuettel wrote:
> Good news, got to look at this on train commute home. It is plainly my
> error. And a fix (of just adding #define R_NO_REMAP before #include'ing
> Rinternals.h) will be forthcoming.  The "length" gave it away.
>
> You can also simply not #include<iomanip> and the error is also avoided.
>
> I'll commit a fix in a bit.
>
> Dirk
>


-- 
Gong-Yi Liao
Department of Statistics
University of Connecticut


-- 
Gong-Yi Liao
Department of Statistics
University of Connecticut


More information about the Rcpp-devel mailing list