run_pyscript {rpymat} | R Documentation |
Run 'Python' script
Description
A wrapper of py_run_file
,
but with rpymat
enabled
Usage
run_script(
x,
work_dir = NULL,
local = FALSE,
convert = FALSE,
globals = list()
)
run_pyscript(
x,
work_dir = NULL,
local = FALSE,
convert = FALSE,
globals = list()
)
run_pystring(
code,
work_dir = NULL,
local = FALSE,
convert = FALSE,
globals = list()
)
Arguments
x |
'Python' script path |
work_dir |
working directory of the script |
local , convert |
passed to |
globals |
named list of global R variables used by 'Python' script |
code |
'Python' code |
Value
The values returned by py_run_file
Examples
## Not run:
# Please configure conda environment first
x <- tempfile()
writeLines(c(
"import re",
"zipcode = re.findall(r'[0-9]{5,6}', r.address)"
), con = x)
address <- '2341 Main St., 72381'
rpymat::run_script(x)
py$zipcode
## End(Not run)
[Package rpymat version 0.1.7 Index]