Skip to content

assigning objects from .C/.Call

2 messages · David James, Brian Ripley

#
Hi,
On Tue, 24 Apr 2001, Prof Brian D Ripley wrote:

            
Using Peter Delgaard's suggestion (and John Chambers', privately)
I suggest the following modified paragraph (edited from R-exts.texi):


@code{defineVar}
creates a new binding or changes the value of an existing binding in the
specified environment frame; in this respect, it is analogous to
@code{assign(symbol, value, envir = rho, inherits = FALSE)},
but unlike \code{assign}, @code{defineVar} does not make a
copy of the object (you can assign a copy of the object in the
environment frame @code{rho} using
@code{defineVar(symbol, duplicate(value), rho)}).
-------------------------------------------------------------------
David A. James
Statistics Research, Room 2C-253            Phone:  (908) 582-3082       
Bell Labs, Lucent Technologies              Fax:    (908) 582-3340
Murray Hill, NJ 09794-0636

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Wed, 25 Apr 2001, David James wrote:

            
Thanks, will add (a variant of).

The real issue is that assign() allows `value' to be an expression, and so
uses the value of evaluating the expression, not that of a variable.

Brian