[R] assignment by value or reference

Xiaobo Gu guxiaobo1982 at gmail.com
Wed Sep 15 16:03:49 CEST 2010


Thanks.



Xiaobo.Gu

>>-----Original Message-----
>>From: Uwe Ligges [mailto:ligges at statistik.tu-dortmund.de]
>>Sent: Wednesday, September 15, 2010 5:06 PM
>>To: Xiaobo Gu
>>Cc: r-help at r-project.org; '顾小波'
>>Subject: Re: [R] assignment by value or reference
>>
>>See the R Language Definition manual. Since R knows about lazy
>>evaluation, it is sometimes neither by reference nor by value.
>>If you want to think binary, then "by value" fits better than "by
>>reference".
>>
>>Uwe Ligges
>>
>>
>>
>>On 05.09.2010 17:19, Xiaobo Gu wrote:
>>> Hi Team,
>>>
>>>           Can you please tell me the rules of assignment in R, by value or
>>by reference.
>>>
>>>> From my about 3 months of experience of part time job of R, it seems most
>>times it is by value, especially in function parameter and return values
>>assignment; and it is by reference when referencing container sub-objects of
>>container objects, such as elements of List objects and row/column objects of
>>DataFrame objectes; but it is by value when referencing the smallest unit of
>>element of a container object, such as cell of data frame objects.
>>>
>>>
>>>
>>>
>>>
>>> Xiaobo.Gu
>>>
>>>
>>>
>>>
>>> 	[[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list