Re: [Rd] Problem calling $ inside a $ method

2007-05-08 Thread Seth Falcon
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

Re: [Rd] Problem calling $ inside a $ method

2007-05-07 Thread Prof Brian Ripley
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

Re: [Rd] Problem calling $ inside a $ method

2007-05-07 Thread Peter Dalgaard
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",

[Rd] Problem calling $ inside a $ method

2007-05-07 Thread Seth Falcon
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