Skip to main content
Question

Rcaller Output having issues with a list of output attributes


Forum|alt.badge.img

Hi,

I want to run some Rscript and so installed an R-interpreter and installed some Libraries. As a test case I downloaded the workspace from a rather old article "RCaller: Ins and outs of using R in FME". The workspace is from 2020 though so i ran it on both 2019 and 2021 versions but it returned the same error in both cases. Actually the exact same error as mentioned in the article itself: "Failed with exit code 1 when executing R script. Output was: Loading required package: gsubfn.......". Now the article mentions to check spelling but as the workspace is an exact copy from safe I expect that to be tested and ok and furthermore that is just not the issue as the line "fmeOutput<-data.frame(meanEst,meanAct, r2, m, k)" in the Rcaller works just fine if I just pick one of the columns for output, irrespective which one. e.g. "fmeOutput<-data.frame(r2)" But the moment I comma separate a few data frame columns for output I get the error.

Any help with this appreciated.

All the best, Robbert

 

PS. also ran the code in RStudio where the code as-in the RCaller transformer works fine

9 replies

Forum|alt.badge.img+2

@rokop​ I ran the workspace template rcallerlinearregression.fmwt using FME 2019.2 and it seems to work OK.

imagePerhaps check that FME is pointing to the expected R Interpreter .

imageThe example doesn't require any special packages to be loaded. rcallerlinearregressionwithgroups.fmwt also seems to work fine in FME 2019.2


Forum|alt.badge.img
  • Author
  • April 29, 2022
markatsafe wrote:

@rokop​ I ran the workspace template rcallerlinearregression.fmwt using FME 2019.2 and it seems to work OK.

imagePerhaps check that FME is pointing to the expected R Interpreter .

imageThe example doesn't require any special packages to be loaded. rcallerlinearregressionwithgroups.fmwt also seems to work fine in FME 2019.2

Hi,

I must have set the interpreter right as it is all working fine outputting 1 attribute to fmeOutput. Also tried both the 32 and 64 bit versions of Rscript. The error i get:

image" data-fileid="0694Q00000HaWCcQAN 

If take off the encircled attribute meanEst it works and the line where it goes wrong then reads instead:

RCaller (InlineQueryFactory): Processing R script

RCaller (InlineQueryFactory): Generating output 'Output' using query 'SELECT * FROM "Output"'

So it seems to fail on the sql when more than 1 attribute is needed.

Cheers,

Robbert


Forum|alt.badge.img+2
rokop wrote:

Hi,

I must have set the interpreter right as it is all working fine outputting 1 attribute to fmeOutput. Also tried both the 32 and 64 bit versions of Rscript. The error i get:

image" data-fileid="0694Q00000HaWCcQAN 

If take off the encircled attribute meanEst it works and the line where it goes wrong then reads instead:

RCaller (InlineQueryFactory): Processing R script

RCaller (InlineQueryFactory): Generating output 'Output' using query 'SELECT * FROM "Output"'

So it seems to fail on the sql when more than 1 attribute is needed.

Cheers,

Robbert

@rokop​ What OS are you running? Also what version of R do you have installed?

 

Try using Log Debug under Tools - FME Options - Translation tab - Log Message Filter and attach that log to this conversation.

It is odd that changing the order and number of attributes causes the crash. I don't see that here.


Forum|alt.badge.img
  • Author
  • May 4, 2022

Hi Mark,

I'm on Windows 10 Enterprise. Running R-4.2.0 on fme 2019.2.

Please find attached the run log

 

Cheers,

Robbert


Forum|alt.badge.img+2
rokop wrote:

Hi Mark,

I'm on Windows 10 Enterprise. Running R-4.2.0 on fme 2019.2.

Please find attached the run log

 

Cheers,

Robbert

@rokop​ Just checking - can you confirm you have installed the sqldf package ?


Forum|alt.badge.img+2
markatsafe wrote:

@rokop​ Just checking - can you confirm you have installed the sqldf package ?

Perhaps also check that you do not have two versions of R installed

 


  • May 27, 2022

Hi, I have the same problem. The transformer only works when the output data frame fmeOutput only contains a single value. Otherwise it fails with the error 

 

Error in if (fmeOutput != "") dbWriteTable(dbcon, "Output", fmeOutput, : 

 the condition has length > 1

 

This screenshot shows it with the only line of code in the RCaller set to:

fmeOutput<-data.frame(numbers=c(1,2,3))

I wonder if an update to one of the packages used by sqldf has caused this to fail. I have the latest version of sqldf installed from Cran today along with dependencies RSQLite, proto, etc.

fme_rcaller


DanAtSafe
Safer
Forum|alt.badge.img+18
  • Safer
  • May 27, 2022
jo-gay wrote:

Hi, I have the same problem. The transformer only works when the output data frame fmeOutput only contains a single value. Otherwise it fails with the error 

 

Error in if (fmeOutput != "") dbWriteTable(dbcon, "Output", fmeOutput, : 

 the condition has length > 1

 

This screenshot shows it with the only line of code in the RCaller set to:

fmeOutput<-data.frame(numbers=c(1,2,3))

I wonder if an update to one of the packages used by sqldf has caused this to fail. I have the latest version of sqldf installed from Cran today along with dependencies RSQLite, proto, etc.

fme_rcaller

Hi @jo-gay Unfortunately the RCaller doesn't work with R 4.2 - FYI the issue is FMEENGINE-73477


Forum|alt.badge.img+2

@jo-gay​ @rokop​ we think we might have addressed this issue in FME 2022.2 - this will be available as a beta download build 22705 or higher. If someone would like to test it when the beta becomes available.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings