Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Paul Gilbert
Gabor Grothendieck wrote: There seem to be two opposing yet valid viewpoints to the question of doing it right vs. compatibility with S-Plus. Compatbility with older version of R is a third overlapping possible goal. There does not appear to be an overall statement of intent in R, but rather, th

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Gabor Grothendieck
EMAIL PROTECTED]> Subject: Re: [Rd] data() misbehaving inside a function >>>>> "KH" == Kurt Hornik <[EMAIL PROTECTED]> >>>>> on Fri, 17 Oct 2003 09:04:40 +0200 writes: >>>>> Peter Dalgaard writes: >> David James <[EMAIL P

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Prof Brian Ripley
On Fri, 17 Oct 2003, Thomas Lumley wrote: > On Fri, 17 Oct 2003, Kurt Hornik wrote: > > > > Peter Dalgaard writes: > > > > > Kurt Hornik <[EMAIL PROTECTED]> writes: > > KH> Or get rid of non-standard evaluation and educate users to use quoted > > KH> strings where strings should be used. > >

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Thomas Lumley
On Fri, 17 Oct 2003, Kurt Hornik wrote: > > Peter Dalgaard writes: > > > Kurt Hornik <[EMAIL PROTECTED]> writes: > KH> Or get rid of non-standard evaluation and educate users to use quoted > KH> strings where strings should be used. > >> > >> > and infuriate those who know and used the S langu

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Gordon Smyth
At 05:50 PM 17/10/2003, A.J. Rossini wrote: Kurt Hornik <[EMAIL PROTECTED]> writes: >> Definitely not worth the pain (I *know* I'd hear ... comments from >> them!)! I might be one of them. You'll hear my screams for weeks... > Actually, I do think it is worth the pain. The way I understand

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Kurt Hornik
> Peter Dalgaard writes: > Kurt Hornik <[EMAIL PROTECTED]> writes: KH> Or get rid of non-standard evaluation and educate users to use quoted KH> strings where strings should be used. >> >> > and infuriate those who know and used the S language for more than 15 >> > years, where help(help) has

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Kurt Hornik
> A J Rossini writes: > Kurt Hornik <[EMAIL PROTECTED]> writes: > >>> Definitely not worth the pain (I *know* I'd hear ... comments from >>> them!)! > I might be one of them. You'll hear my screams for weeks... [Fortunately, you're mostly in Seattle ...] >> Actually, I do think it is

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Peter Dalgaard
Kurt Hornik <[EMAIL PROTECTED]> writes: > KH> Or get rid of non-standard evaluation and educate users to use quoted > KH> strings where strings should be used. > > > and infuriate those who know and used the S language for more than 15 > > years, where help(help) has always worked? > > I would t

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread A.J. Rossini
Kurt Hornik <[EMAIL PROTECTED]> writes: >> Definitely not worth the pain (I *know* I'd hear ... comments from >> them!)! I might be one of them. You'll hear my screams for weeks... > Actually, I do think it is worth the pain. The way I understand it, we > have a strategic decision to gra

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Kurt Hornik
> Martin Maechler writes: > "KH" == Kurt Hornik <[EMAIL PROTECTED]> > on Fri, 17 Oct 2003 09:04:40 +0200 writes: > Peter Dalgaard writes: >>> David James <[EMAIL PROTECTED]> writes: Calls of the form data(package = pkg) inside a function incorrectly fail ("pkg" is a

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Martin Maechler
> "KH" == Kurt Hornik <[EMAIL PROTECTED]> > on Fri, 17 Oct 2003 09:04:40 +0200 writes: > Peter Dalgaard writes: >> David James <[EMAIL PROTECTED]> writes: >>> Calls of the form data(package = pkg) inside a function >>> incorrectly fail ("pkg" is a local variable). For

Re: [Rd] data() misbehaving inside a function

2003-10-17 Thread Kurt Hornik
> Peter Dalgaard writes: > David James <[EMAIL PROTECTED]> writes: >> Calls of the form data(package = pkg) inside a function >> incorrectly fail ("pkg" is a local variable). For instance, >> >> foo <- function(pkg) data(package = pkg) >> foo("base") >> Error in .find.package(package, lib.l

Re: [Rd] data() misbehaving inside a function

2003-10-16 Thread Peter Dalgaard
Peter Dalgaard <[EMAIL PROTECTED]> writes: > foo <- function(pkg) eval(substitute(data(package))) ^^^ Doh. "pkg", of course. -p -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N

Re: [Rd] data() misbehaving inside a function

2003-10-16 Thread Prof Brian Ripley
Yes, but this is not to do with being inside a function: pkg <- "base" data(package=pkg) ilustrates it, and library etc behave in the same way (except library can make use of character.only = TRUE). You can use substitute, too, as in foo <- function(pkg) eval(substitute(data(package = pkg), lis

Re: [Rd] data() misbehaving inside a function

2003-10-16 Thread Peter Dalgaard
David James <[EMAIL PROTECTED]> writes: > Calls of the form data(package = pkg) inside a function > incorrectly fail ("pkg" is a local variable). For instance, > >foo <- function(pkg) data(package = pkg) >foo("base") >Error in .find.package(package, lib.loc, verbose = verbose) : >

[Rd] data() misbehaving inside a function

2003-10-16 Thread David James
Calls of the form data(package = pkg) inside a function incorrectly fail ("pkg" is a local variable). For instance, foo <- function(pkg) data(package = pkg) foo("base") Error in .find.package(package, lib.loc, verbose = verbose) : none of the packages were found ## workar