user:code:r [Promethee]

The R Project for Statistical Computing

Wrapping

  • input: ”.R” script file
  • input parameters syntax
    • variable:
      ?{variable_name}
    • formula:
      ![formula_expression]
  • output: detects output expressions like
    cat(“z =”,...
    lower case output taken as scalar float, upper case as 1D array of float
  • running progress: last line of ”.Rout” file

Example

  • input file:
    branin <- function(x) {
    	x1 <- x[1]*15-5   
    	x2 <- x[2]*15     
    	(x2 - 5/(4*pi^2)*(x1^2) + 5/pi*x1 - 6)^2 + 10*(1 - 1/(8*pi))*cos(x1) + 10
    }
     
    cat("X = ",c( ?a , ?b ),"\n");
    cat("z = ",branin(c( ?a , ?b )),"\n");
  • input variables: a, b
  • output: z (scalar), X (array)

Installation

  • user side:
    • unzip in Promethee installation directory,
    • restart Promethee GUI.
  • server side:
    • unzip in Promethee installation directory,
    • open shell console, check “R CMD BATCH Promethee_Install_Path/examples/branin.R” creates a “branin.Rout” file,
    • add
      <CODE name="R" cplugin="file:./plugins/calc/R.cplugin.jar" command="R CMD BATCH" />
      line in calculator.xml file inside ”<calculator>” tag,
    • wait for configuration refresh (5 s. if calculator is free).
© IRSN - All right reserved - Legal information