py.rm: Remove a Python variable from R

Description Usage Arguments Examples

Description

This function uses the del Python command to remove a variable and reclaim its memory. Any exceptions, such as the one that would happen if the variable did not exist, will be caught and ignored.

Usage

1
py.rm(var.name, stopOnException = FALSE)

Arguments

var.name

a character string containing a valid Python variable name

stopOnException

if TRUE then stop will be called if a Python exception occurs, typically because the variable doesn't exist, otherwise only a warning will be flagged

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
py.assign("a", "foo bar")
py.get("a")
# [1] "foo bar"
py.rm("a")
## Not run: 
py.rm("a")
# Warning message:
# In py.rm("a") : Traceback (most recent call last):
#   File "<string>", line 2, in <module>
# NameError: name 'a' is not defined

## End(Not run)

SnakeCharmR documentation built on May 2, 2019, 6:21 a.m.