py.load: Reads and executes Python code from a file

Description Usage Arguments Details Value

View source: R/py.load.R

Description

This function runs Python code contained in a file. This is basically a convenience function that is the equivalent of py.exec(readLines(file)).

Usage

1
py.load(file, stopOnException = TRUE)

Arguments

file

a connection or file name that will be passed to readLines to read the Python code in the file

stopOnException

logical value indicating whether to check or not to call stop if a Python exception occurs

Details

For better maintainability, it might be worth investigating concentrating more complex Python code that needs to be called from R into proper packages that can be installed using pip and loaded with py.exec("import package_name").

Value

if stopOnException is FALSE, invisibly returns a string representation of any raised Python exceptions or NULL if none occur.


asieira/SnakeCharmR documentation built on Jan. 3, 2020, 7:27 a.m.