Table Of Contents

Previous topic

pyCall

Next topic

pyDict

This Page

pyConnect

Connects R to Python. (The parameters are only needed for the Windows version!)

There is a different behavior for the static (Linux default) and the explicit linked (Windows default) version. Where as the static linked version automatically connects, when the package get’s loaded, the explicitly linked version needs to be connected manually. More information can be found at the README file or at http://pythoninr.bitbucket.org/.

Usage

pyConnect(pythonExePath = NULL, dllDir = NULL, pythonHome = NULL)

Arguments

pythonExePath   a character containing the path to "python.exe" (e.g. "C:\\Python27\\python.exe")
dllDir   an optional character giving the path to the dll file. Since the dll file is normally in a system folder or in the same location as python.exe, this parameter is \bold{almost never needed}!
pythonHome   an optional character giving the path to PYTHONHOME. On Windows by default PYTHONHOME is the folder where python.exe is located, therefore this parameter is \bold{normally not needed}.

Examples

\dontrun{
## Linux examples
pyConnect() # is done by default when the package is loaded

## Windows examples
pyConnect() ## will try to detect a suitable python version
            ## from the PATH given in the environment variables
pyConnect("C:\\\\Python27\\\\python.exe")

## One can also explicitly set the parameters for the connection.
PythonInR:::pyConnectWinDll(dllName="python27.dll", dllDir=NULL,
                            majorVersion=2, pythonHome="C:\\\\Python27",
                            pyArch="32bit")
}