[ top | up ]

Assign a Value to a Name

Syntax

assign(x, value, envir=sys.frame(sys.parent()),
        inherits=FALSE, immediate=TRUE)

Arguments

x a variable name (given as a quoted string).
value a value to be assigned to x.
envir the environent in which to assign. The default is the environment where the call to assign takes place.
inherits should the enclosing frames of the environment be inspected.
immediate an ignored compatibility feature.

Value

This function is invoked for its side effect, which is assign value to the variable x. If no envir is specified, then the assignment takes place in the currently active environment.

If inherits is TRUE then parents of the supplied environment are searched until the variable x is encountered. The value is then assigned in the environment in which the variable 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.