Solved

Getting R to play nice with FME Server.

  • 19 January 2023
  • 3 replies
  • 34 views

Badge +14

I got a good one! I am working with the RCaller transformer and doing some good things on the workbench side. I decided to automate a process for non-R programmers to create ggplots of their sensor data. This process worked great on the ol' laptop, so I migrated to my FME Server. I have worked through the version of R (downgrade) to 4.1.3 per FME documentation. I had to change the default path of the libraries as well to make everything play nice. I have run this file on the SAME server as the FME Server install and it runs without error in workbench on that box. When I run the same file in server I am getting this message: 2023-1-19 14:40:45 | RCaller_2 (InlineQueryFactory): Encountered an error when starting R interpreter. Check that R is installed and that the R interpreter path is set in Workbench's "Translation" settings ( http://fme.ly/rcaller ). Message was: Process failed to start: The system cannot find the file specified.

It is at least consistent. I've done the sqldf library stuff, and pointed to Rscript.exe in my bin folder. Any guidance, tricks, or information would be appreciated.

icon

Best answer by wisegis 23 January 2023, 18:32

View original

3 replies

Badge +2

@wisegis​ What versions of FME Desktop & Server? Do you have a small example workspace that reproduces this on your FME Server?

Perhaps also look at the R & FME Server notes here

Badge +14

The only thing I think may work located at the end of the documentation; it has an example of forcing the FME Server to see the path in its settings. I can't get the syntax right after I set up the command line in admin mode on the server.

 

<FMEServerDir>Server/fme/fme.exe APPLY_SETTINGS SYSTEM "Settings/Rscript Interpreter" <path_to_executable>

It keeps saying it's an unrecognized command. If I can get this setting changed, the server should be able to fire off the rest.

 

I also loaded the libraries directly into FME Server through the web interface under resources > Engine> Plugins>R. I put the sqldf and the tidyverse libraries there, and the job still failed.

Badge +14

@wisegis​ What versions of FME Desktop & Server? Do you have a small example workspace that reproduces this on your FME Server?

Perhaps also look at the R & FME Server notes here

Ok. I got the syntax correct. I knew it was something dumb on my end like quotes....

 

"C:\\Program Files\\FMEServer\\Server\\fme\\fme.exe" APPLY_SETTINGS SYSTEM "Settings/Rscript Interpreter" "C:\\Program Files\\R\\R-4.1.3\\bin\\x64\\Rscript.exe"

 

It was able to run without error in FME Server.

 

The only other issue I see is that in my Rcaller I push out multiple ggplots. They work fine in workbench creating two excel spreadsheets and around five ggplots. I attached a template file to show this. In FME Server it is creating a zip file with the data download service that has the two excel spreadsheets, but not the plots. I made sure that all the same libraries that are called out in the Rcaller reside in the plugins > R folder as well.

 

How would you recommend I get those plots to export using an FME Server Data Download service?

Reply