Bug #4827
openRExpression does not handle matrix tokens correctly.
0%
Description
I've attached a simple workflow that demonstrates a bug in the way the RExpression actor translates Kepler/Ptolemy matrices to R matrices. There seems to be a problem in the autmatically generated "matrix" statement in R that is likely due to confusing row and column counts.
A simple 2 row x 5 column constant matrix ([1, 2, 3, 4, 5; 101, 102, 103, 104, 105]) is passed to Rexpression on the min port. The R script simply displays the matrix and passes it along to the mout port.
There are three displays.
1. min displays the matrix before it enters the RExpression actor. It is fine.
2. mout displays the matrix after it leaves the RExpression actor. It too is fine (indicating that the translation problem inverts itself when baorcasting to the output port).
3. The problem is in the Routput display.
[,1] [,2] [,3] [,4] [,5]min
[1,] 1 3 5 102 104
[2,] 2 4 101 103 105
Note how the matrix is scrambled. The automatically generated R script line that reads:
`min` <- matrix(c(1, 2, 3, 4, 5, 101, 102, 103, 104, 105), nrow=2,ncol=5)
should read
`min` <- matrix(c(1, 101, 2, 102, 3, 103, 4, 104, 5, 105), nrow=2,ncol=5)
Files