pyConnect: connects R to Python

View source: R/PythonInR.R

pyConnectR Documentation

connects R to Python

Description

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

Usage

pyConnect(dllDir = NULL, pythonHome = NULL)

Arguments

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

## 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

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

## End(Not run)

Sage-Bionetworks/PythonEmbedInR documentation built on April 17, 2023, 4:23 p.m.