RExpression2 - handle arbitrary R data structures
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?).
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)
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...
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)
tests the various structures are transferred by the JRI implementation.
Original Bugzilla ID was 4002
Also available in: Atom