Renjin : printing "externalptr"

97 views Asked by At

From Java code I'm pushing into Renjin a data.frame. The fisrt vector of this data frame contains native Java objects as ExternalPtr. Everything works fine including accessing those objects from R code. Nevertheless, I noticed that printing those objects (for debugging purpose) using the print() function does not help much.

print( ptr )

is printing the classname and a sort of hashcode:

<pointer: foo.Class@f0815dc

Similarly

print( list-of-ptr )

is printing:

[[1]] <pointer: foo.Class@3a915df8  
[[2]] <pointer: foo.Class@2e4b32f7

Is there anyway to have the #toString() or any other Java method being called?

By the way, I noticed that printing the whole data frame is throwing an exception:

Caused by: org.renjin.eval.EvalException: Invalid argument:
    format(externalptr, logical, NULL, integer, NULL, integer, logical, logical)
    Expected:
    format(character, logical(1), any, any, any, integer(1), logical(1), any)
    format(LogicalVector, logical(1), any, any, any, integer(1), logical(1), any)
    format(DoubleVector, logical(1), any, integer(1), any, integer(1), logical(1), any)
    format(IntVector, logical(1), any, integer(1), any, integer(1), logical(1), any)
    at org.renjin.primitives.R$primitive$format.doApply(R$primitive$format.java:96)

Is there anyway to prevent that?

0

There are 0 answers