Bug #4002
openRExpression2 - handle arbitrary R data structures
0%
Description
Not everything in R fits into the Ptolemy types (nor the JRI types, for that matter).
The lm() method, for instance, returns something special.
It's been proposed (a few times) that there should be an RObjectToken to handle such cases so that at least R actors can communicate between each other with out loss/mutation of data.
The RExpression1 actor used file-based serialization to get around this limitation. We could attempt to use a hybrid approach for RExpression2 - mixing JRI with file-based serialization (best of both worlds?).
Files
Updated by ben leinfelder over 15 years ago
Here is an example script that creates different data objects:
x <- 1:10
y <- x + rnorm(10)
f <- y ~ x
l <- lm(f)
s <- summary(l)
Updated by ben leinfelder over 15 years ago
added handling (from the old RExpression1 implementation) for [un]serializing complex R data objects to disk.
This is working for dataframes at the moment. More testing for complex types to come...
Updated by ben leinfelder over 15 years ago
in the example cases given, all but the structure produced by ~ were transferred from one R actor the the other.
This is the debug output:
f <- (y ~ x)
Result: nil
Updated by ben leinfelder over 15 years ago
tests the various structures are transferred by the JRI implementation.