rebind: Rebind an existing name.

Description Usage Arguments Details Examples

View source: R/rebind.r

Description

This function is similar to <<- with two exceptions:

Usage

1
rebind(name, value, env = parent.frame())

Arguments

name

name of existing binding to re-assign

value

new value

env

environment to start search in.

Details

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
a <- 1
rebind("a", 2)
a
# Throws error if no existing binding
## Not run: rebind("b", 2)

local({
  rebind("a", 3)
})
a

# Can't find get because doesn't look past globalenv
## Not run: rebind("get", 1)

hadley/pryr documentation built on Feb. 20, 2018, 6:11 a.m.