Prof Brian Ripley <[EMAIL PROTECTED]> writes:
> In x$name, 'name' is supposed to be a symbol, unevaluated, or a
> literal character string (but not a character vector).
>
>> f <- list(bob=1, alice=2)
>> `$`(f, "bob")
> [1] 1
>> nm <- "bob"
>> `$`(f, nm)
> NULL
Thanks, this is the piece I was miss
In x$name, 'name' is supposed to be a symbol, unevaluated, or a
literal character string (but not a character vector).
> f <- list(bob=1, alice=2)
> `$`(f, "bob")
[1] 1
> nm <- "bob"
> `$`(f, nm)
NULL
illustrates your misunderstanding.
Note that the S4 generic for $ in fact is
"$" = function(x
Seth Falcon wrote:
> Hello,
>
> I wonder if this will make it through the spam filters given the
> subject line.
>
> I'm seeing the following when trying to call a dollar method inside of
> a dollar method.
>
>
> setClass("Foo", representation(d="list"))
> [1] "Foo"
>
> f <- new("Foo",
Hello,
I wonder if this will make it through the spam filters given the
subject line.
I'm seeing the following when trying to call a dollar method inside of
a dollar method.
setClass("Foo", representation(d="list"))
[1] "Foo"
f <- new("Foo", d=list(bob=1, alice=2))
## We can call