Home · Quickstart · User Guide and Examples · Interfaces Index · Developers · About · Nipy

# nipype.interfaces.r module

Interfaces to run R scripts.

## RCommand

Link to code

> Bases: CommandLine

> Interface that runs R code

>     >>> import nipype.interfaces.r as r
>     >>> r = r.RCommand(rfile=False)
>     >>> r.inputs.script = "Sys.getenv('USER')"
>     >>> out = r.run()

> scripta unicode string

>   R code to run. Maps to a command-line argument: `-e "%s"` (position: -1).

> argsa unicode string

>   Additional parameters to the command. Maps to a command-line argument: `%s`.

> environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

>   Environment variables. (Nipype default value: `{}`)

> rfilea boolean

>   Run R using R script. (Nipype default value: `True`)

> script_filea pathlike object or string representing a file

>   Name of file to write R code to. (Nipype default value: `pyscript.R`)

> RCommand.set_default_r_cmd(r_cmd)

>   Set the default R command line for R classes.

>   This method is used to set values for all R subclasses.

> RCommand.set_default_rfile(rfile)

>   Set the default R script file format for R classes.

>   This method is used to set values for all R subclasses.

nipype.interfaces.r.get_r_command()