Learn R Programming

PythonInR (version 0.1-12)

pyGet0: Creates an R representation of an Python object

Description

The function pyGet0 gets Python objects by name.

Usage

pyGet0(key)

Arguments

key

a string specifying the name of a Python object.

Value

Returns the specified Python object converted into an R object if possible, else a virtual Python object.

Details

Primitive data types like bool, int, long, float, str, bytes and unicode are returned as R objects. Python tuples, lists, dictionaries and other Python objects are returned as virtual Python objects.

Examples

Run this code
# NOT RUN {
if ( pyIsConnected() ){
pyExec("import os")
os <- pyGet0("os")
os$getcwd()
os$sep
os$sep <- "Hello Python!"
pyExecp("os.sep")
}
# }

Run the code above in your browser using DataLab