Copyright © 2018 EarthSoft, Inc • Modified: 12 Dec 2018
A R Project button is available in EQuIS Professional. It can be found under the Data tab as shown below.
To learn more about R Project, visit here.
The EQuIS for R Project interface provides help exporting EQuIS Data into R Project. EQuIS for R Project is specifically designed for exporting data into R-Studio, but can also be used with other R Software. EQuIS Professional provides two methods for exporting data into R Project. The first is the R Project Form which can be opened by clicking the R Project button in the Standard section of the Data Ribbon, and the second is by clicking the R Project Export button found in any of the data grid toolbars within EQuIS Professional. In order to use either of the EQuIS for R Project export features, you need to first install R on your machine.
The EQuIS for R Project Form is used to create a .R Script file, which can then be loaded and run in R Project. To open the R Project Form in EQuIS Professional, locate the Data tab and click the R Project button in the Standard section.
1.Project Folder: Used to specify the current working directory.
2.R Script Title: The title of the .R script file currently open.
3.Select Executable Path Button: Used to select which R application to export data to (looks for R-Studio by default).
4.Import Data Button: Used to add previously saved .csv data files to the .R script.
5.Save R Script Button: Saves the current text from the R Script Text Editor to a .R Script file.
6.Load R Script Button: Loads a previously saved .R Script file into the R Script Text Editor.
7.Export Button: Sends the current R Script to be opened and run in R Project.
8.Refresh Button: Refreshes the R Script Editor to load all currently open tables from the EQuIS workspace.
9.R Script Text Editor: Displays and modifies the currently open .R Script file.
The R Project Form will automatically load any tables, reports or crosstab reports that are open in the EQuIS workspace. Each item that is loaded into the form will automatically be saved as a .csv file in the current Project Folder when the Export button is clicked. The form also includes a Refresh button which will reload the EQuIS workspace.
Note: It is a good idea to save the R Script before refreshing the form to avoid losing work. After the Refresh button is clicked, any previously open tables or data files will be removed and the form will be reloaded with only those tables and reports that are open in the workspace.
Data can also be loaded into the form through the Import Data button. This option allows the user to select any previously saved csv files to be included in the .R Script.
The Select R Executable button provides the option to specify which applications should be used when opening exported data. There are two executable paths that can be specified, the R executable path, and the R Script executable path. The R Project Form only requires the R executable path to be specified; however, the R Export button in the data grid toolbar requires both paths to be specified.
Note: If using RStudio, the executable paths will automatically be populated. If the user specifies their own executable paths instead, then the export will first look for the paths specified.
The R Executable path is used to define the application that will be opened when exporting data to R Project. The R Script path points to the RScript.exe file which is used to run the scripts from the command line when exporting. Once specified, the executable paths are stored in R settings for future reference.
Once all tables, reports, and data files are specified and saved in the .R Script they can be exported into R Project by clicking the Open R Project button. If the script has not already been saved, a prompt to save the file will appear. Also, a prompt will a appear if there are any existing data files that would otherwise be overwritten in the export.
After the export completes, the .R script will open up in the application (If using an application other than RStudio the script may need to be loaded manually). After it is opened, the script can be run by selecting the desired lines and clicking the Run button. This will complete the data loading process and the data will be ready to be used by R Project for statistical computing.
The R Project Export button in the EQuiS data grid toolbar is a second option that is available for exporting data into R Project.
This option can be used to quickly export a single data table from EQuIS Professional into R Project. Open the desired table, report, or crosstab and click the R Project Export button. This will launch R Project and automatically run the needed R scripts to import the data. The imported data will then be ready to be used in R Project.
•This feature is specifically designed to work with RStudio. Although other R software may be used, the export will not necessarily work with other software.
•This feature requires both an R Project executable path and an R Script executable path to function properly. If either of these paths is missing, the export will not work.