From spinuvit.list at gmail.com  Mon Oct 25 14:14:18 2010
From: spinuvit.list at gmail.com (Vitalie S.)
Date: Mon, 25 Oct 2010 14:14:18 +0200
Subject: [Rd] "$<-" fails (invalid subscript type 'language')
References: <cpnwrp7zs2t.fsf@gmail.com>
	<FB9D7384-795F-4EB1-8ABE-A1C1BD11977D@comcast.net>
	<87fwvv7355.fsf@gmail.com> <4CC49EFC.7090801@gmail.com>
	<874oca7m1n.fsf@gmail.com>
Message-ID: <cpnlj5mzcyt.fsf@gmail.com>

spinuvit.list at gmail.com (Vitalie S.) writes:

>
> I would expect the following to behave identically:
>
>> tv <- c(a="dsf", b="sss")
>> tl <- list(232)
>
>> `$<-`(tl, tv[[1]], "sdfdsfdsfsd")
> Error: invalid subscript type 'language'
>
>> tl$`tv[[1]]` <- "sdfdsfdsfsd"
>> tl
> [[1]]
> [1] 232
>
> $`tv[[1]]`
> [1] "sdfdsfdsfsd"
>
> So what is relay going on? In one case the name is expected, in another case any
> "language" object would work?


>
>> If you insist, you can do things like
>>
>> eval(bquote(`$<-`(x, .(as.name(tv[[1]])), 4343)))
>>
>> or similar constructs using substitute().
>>
>> However, the whole situation suggests that you are really looking for
>> methods for "[[<-".

Yap, I see now, `tv[[1]]` is a name. So no contradiction.

To conclude, only the symbol is allowed as index and I can not do absolutely
anything to make my custom "$" "smarter":(.

Thanks everyone for helping me filter some noise in my head.



[Rd] "$<-" fails (invalid subscript type 'language')
Vitalie S.