Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FIXED: Bug #457 - OpenInR sometimes fails to transfer the table to R

(size parameter to read the binary Rdata was too small in some cases. file size now retrieved by R command instead of using the function 'estimateNumValues')
  • Loading branch information...
commit b3b6567880fdee01bddf621c4138ed1869138cea 1 parent 76d6e61
niederle authored
View
11 r4knime/src/de/mpicbg/tds/knime/scripting/r/OpenInRNodeModel.java
@@ -70,7 +70,7 @@ protected OpenInRNodeModel() {
workspaceFile = File.createTempFile("rplugin", ".RData");
workspaceFile.deleteOnExit();
- REXP xp = connection.parseAndEval("r=readBin(tmpwfile,'raw'," + estimateNumValues(inData) + "); unlink(tmpwfile); r");
+ REXP xp = connection.parseAndEval("r=readBin(tmpwfile,'raw',file.info(tmpwfile)$size); unlink(tmpwfile); r");
FileOutputStream oo = new FileOutputStream(workspaceFile);
oo.write(xp.asBytes());
oo.close();
@@ -119,8 +119,9 @@ public static void openWSFileInR(File workspaceFile, String script) throws IOExc
/**
* Attempts to find an upper bound of the number of values of node input.
+ * USAGE IN 'execute' method HAS BEEN REPLACED BY AN R-COMMAND - CAN BE DELETED AT SOME POINT
*/
- private int estimateNumValues(BufferedDataTable[] pushTable) {
+ /* private int estimateNumValues(BufferedDataTable[] pushTable) {
int inputSize = 0;
@@ -133,10 +134,10 @@ private int estimateNumValues(BufferedDataTable[] pushTable) {
return (int) (10.1 * inputSize); // add some size for meta data like table headers
- }
+ } */
- private int calcTableSize(BufferedDataTable bufferedDataTable) {
+ /* private int calcTableSize(BufferedDataTable bufferedDataTable) {
return bufferedDataTable.getDataTableSpec().getNumColumns() * bufferedDataTable.getRowCount();
- }
+ } */
}
Please sign in to comment.
Something went wrong with that request. Please try again.