You are here: Administrator's Guide > Other Common Tasks > Licensing and Administration > Configuring the FME Engine > Using R with FME Server

Using R with FME Server

To execute R scripts from FME Server, such as through the RCaller transformer in an FME Desktop workspace, you must perform the following on all machines that run FME Engines:

  1. Install R
  2. Install the sqldf package for R

Alternatively, you can direct FME Server to an R interpreter that is installed in a non-standard location.

Install R

Download R installers from https://www.r-project.org/.

Windows

  • Run the installer that matches your FME Server bit version: 64- or 32-bit.
  • Run the installer as administrator. Right-click on the installer in the Start menu and select Run as administrator.

Linux

To install R on Linux, we recommend using a package manager.

Install the sqldf package for R

Choose one of the following options:

  • Standard install (perform on all machines that run FME Engines)
  • Upload to Resources

Standard Install

  1. Open the R command prompt as administrator, and run the following command:
  2. install.packages('sqldf')

  3. A window launches prompting you to select a download mirror. After selecting a mirror, the sqldf package is installed to the system-wide R library.
  4. To verify that sqldf is installed correctly, run the following command:
  5. .libPaths()

    The returned path should include a folder sqldf.

Upload to Resources

Use the Upload tool on the Resources page of the FME Server Web User Interface, and upload the package libraries under Engine\Plugins\R.

Using an R Interpreter Installed in a Non-Standard Location

You can direct FME Server to use an R interpreter that is installed in a non-default location. To set the path to the interpreter you want FME Server to use, run the following command from a command prompt, on all machines running FME Engines:

Windows

Note: To avoid errors, the Windows Command Prompt must likely be run as administrator, even if you are currently running your machine with administrator privileges. From the Start Menu, right-click on Command Prompt and select Run as administrator.

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

Linux

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