I have a very strange problem with remote R Snippets in KNIME (using KNIME in windows and sending the work packages to Rserve running under Linux).
The following code works both in a local and in a remote R Snippet:
a<-"foo"
b<-"bar"
R<-paste(a,b)
Result:
[1] "foo bar"
The following code works only in local R Snippets:
a<-"foo"
b<-"bar"
R<-c(a,b)
Result:
[1] "foo" "bar"
However, the remote Snippet returns (in Console):
Quote:
ERROR R Snippet (Remote) Execute failed
:shock:
Can anybody help me with this?
Many Thanks,
Phil.
P.S.: I just tried using a local "remote" Rserve (starting Rserve() in a local R window in Windows after downloading the library). The results are the same as above, first example works, second example doesn't).
Hi! Sorry, I can't reproduce the problem, can you please change the console log level to DEBUG in the KNIME Preferences and send me the stack trace you get, when you execute the R Snippet (Remote) node. For me, both cases and scripts work fine; I am running KNIME 1.3.5 with R 2.5.0 and Rserve 2.4.0. Cheers, Thomas
Hi Liz, Hi mixmaxx,
I am not able to reproduce this behavior using KNIME 2.1.2 together with R version 2.7.2 - I started Rserve() and the following script executes successfully:
a<-"foo"
b<-"bla"
R<-c(a,b)
resulting in on column with two rows containing “foo” and “bla”.
I think I have worked out where the R Remote Server snippet is breaking. In the code below, R contains a table in the format . I am trying to split the list of numbers and get the log of the median for each row:
dataMatrix <- data.frame(R[1:10,])
dataMatrix$new <- as.vector(dataMatrix[,2])
for (i in 1:10)
{
dataMatrix[i,4] <- log(median(sapply(unlist(strsplit(dataMatrix[i,3],", ")), as.numeric)))
}
R <- dataMatrix[,c(1,4)]
This code runs fine in the local R snippet but fails in the remote R. When I comment out the loop then the code completes in remote R. Any ideas why the loop is making it fail?