[R] mutable objects

Vadim Ogranovich vograno at arbitrade.com
Mon Jul 15 21:46:56 CEST 2002


Thank you for your reply. I knew I could modify the args in .Call (and even
in .C though not by default), but I was scared off by "not recommended" in
the manual. Is there a simple rule that tells when it's safe to modify the
args in place, or probably give an example when it is NOT safe?

Thanks, Vadim

-----Original Message-----
From: Duncan Temple Lang [mailto:duncan at research.bell-labs.com]
Sent: Monday, July 15, 2002 12:26 PM
To: Vadim Ogranovich
Cc: 'r-help at lists.R-project.org'
Subject: Re: [R] mutable objects

Vadim Ogranovich wrote:
> Hi,
> I need "mutable" objects that I can safely modify in my C code. All call
> interfaces, e.g. .C, .Call, etc., require you to not modify the "in" args.

I took a quick look at the code for .Call() and it appears not to copy
its arguments. As a result, however, you can use this to modify objects in
place and they effects will persist. This is not "recommended" but
does work for many purposes.

This e-mail, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information.  If you are not the intended recipient of this
e-mail, you are hereby notified that any dissemination, distribution or
copying of this e-mail, and any attachments thereto, is strictly prohibited.
If you have received this e-mail in error, please immediately notify me and
permanently delete the original and any copy of any e-mail and any printout

E-mail transmission cannot be guaranteed to be secure or error-free.  The
sender therefore does not accept liability for any errors or omissions in
the contents of this message which arise as a result of e-mail transmission.

NOTICE regarding privacy and confidentiality 

Knight Trading Group may, at its discretion, monitor and review the content
of all e-mail communications. 

r-help 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-help-request at stat.math.ethz.ch

More information about the R-help mailing list