[R] how to get a primitive function object

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Thu Jan 22 22:34:28 CET 2009


Yi Zhang wrote:
>
>>>> # now what?? &%#*
>>>>         
>> now you are really motivated to use '=' instead of '<-':
>>
>> x = 3
>> x
>> # 3
>>
>> vQ
>>
>>     
>
> Thanks. That certainly is an option. But I want to preserve `<-`'s
> functionality because I'm writing a package and I don't want to limit
> the package user's freedom to use `<-`...
>
>   

i was sort-of joking, though it's a real option if you want it. 

but seriously, there's no reason for the &%#* lamenting:

x <- 1
'<-' = function(x,y) 0
x <- 2
# 0

.Primitive('<-')(x,2)
x
# 2

base::'<-'(x, 3)
x
# 3

base::'<-'('<-', base::'<-')
x <- 4
x
# 4

vQ




More information about the R-help mailing list