connects R to Python

Description

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

Usage

1
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 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 normally not needed.

Details

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/.

Note

See the README for more information about the Windows setup.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
## 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")

## End(Not run)