[ top | up ]

Assign a Value to a Name

Syntax

assign(x, value, envir=null, inherits=false)

Arguments

x a symbol (given as a quoted string).
value a value to be assigned to x.
envir the environent in which to assign.
inherits should the enclosing frames of the environment be inspected.

Description

assign assigns value to the symbol x. If envir is null then the assignment takes place in the currently active environment.

If inherits is true then parents of the supplied environment are searched until the symbol x is encountered. The value is then assigned in the environment in which the symbol is encountered. If the symbol is not encountered then assignment takes place in the global environment.

If inherits is false then assigment takes place in the initial frame of envir.