Statistical Algorithms Importer: R-blackbox Project FAQ

From Gcube Wiki
Revision as of 11:14, 18 October 2018 by Giancarlo.panichi (Talk | contribs) (Created page with "{| align="right" ||__TOC__ |} F.A.Q. of Statistical Algorithms Importer (SAI), here are common mistakes we have found in R-blackbox Project. == Parameters == This type of pr...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

F.A.Q. of Statistical Algorithms Importer (SAI), here are common mistakes we have found in R-blackbox Project.

Parameters

This type of project (other than an R project) requires that the parameters are passed at command line when your R file is invoked. This is why your R file must be able to directly read the arguments passed in the command line. As you can see from the invocation:

  • Rscript --vanilla rscript.R "parameter1" "parameter2" "parameterN"

so:

  • args[1] = "parameter1"

In this case, if in your algorithm parameter1 is a file you can read the file in this way:

  • file_input <- file(args[1], "r")

Remember that the algorithm runs take place on servers (DataMiner server) that are different from those where your workspace files are stored. These receive data for executions and produce the results that are then stored in your workspace. So if the algorithm produces output files then the names of these files must be written as default values when the output parameters are declared in the SAI project.