Re: [Rd] [R] function changes argument (PR#9216)

2006-09-11 Thread murdoch
(This report appeared in R-help. I've sent it separately to the bugs list to avoid a long string of cross-postings.) On 9/11/2006 4:49 AM, Moeltner, Andreas wrote: > Dear R-list, > > the following function f changes L. I thought, assignments within > functions are only local? That looks like a

Re: [Rd] [R] function changes argument (PR#9216)

2006-09-11 Thread Prof Brian Ripley
I can tell you where the problem is and a workaround: f <- function(LL) for (ll in names(LL)) LL[[ll]]$txt<-"changed in f" works. The problem is that for() is directly exposing the elements of a list. Of course, a more idiomatic construction would be LL <- lapply(LL, function(x) x$txt <- "cha

Re: [Rd] [R] function changes argument (PR#9216)

2006-09-11 Thread ripley
I can tell you where the problem is and a workaround: f <- function(LL) for (ll in names(LL)) LL[[ll]]$txt<-"changed in f" works. The problem is that for() is directly exposing the elements of a list. Of course, a more idiomatic construction would be LL <- lapply(LL, function(x) x$txt <- "cha

[Rd] S4 Method dispatch in recent 2.4.0alpha

2006-09-11 Thread Oosting, J. \(PATH\)
I use 2 packages that both implement a S4 plot method, where one package depends on the other (the bioconductor package globaltest which depends on multtest). When the plot method is used from within the package, it seems the default plot method is used, and an error is generated. When the method i

Re: [Rd] [R] function changes argument (PR#9216)

2006-09-11 Thread Peter Dalgaard
[EMAIL PROTECTED] writes: > I can tell you where the problem is and a workaround: > > f <- function(LL) for (ll in names(LL)) LL[[ll]]$txt<-"changed in f" > > works. The problem is that for() is directly exposing the elements of a > list. > > Of course, a more idiomatic construction would be

Re: [Rd] [R] function changes argument (PR#9216)

2006-09-11 Thread Prof Brian Ripley
On Mon, 11 Sep 2006, Peter Dalgaard wrote: > [EMAIL PROTECTED] writes: > > > I can tell you where the problem is and a workaround: > > > > f <- function(LL) for (ll in names(LL)) LL[[ll]]$txt<-"changed in f" > > > > works. The problem is that for() is directly exposing the elements of a > > l

Re: [Rd] S4 Method dispatch in recent 2.4.0alpha

2006-09-11 Thread John Chambers
Good example. The basic problem is in the NAMESPACE file: importFrom(graphics, plot) But the version of plot() in the graphics package is not a generic function. Therefore, when your mpplot() calls it there is no method dispatch. You need to import the generic version of plot() from minipk

[Rd] Failure to build home-made package on WINDOWS 2000 professional

2006-09-11 Thread Joost Schalken
Dear all, I am trying to build a home-made package (log2html) to log R output to an HTML file. The package can be build successfully under Solaris, however I am unable to build the system under Windows 2000 Professional. I read (and tried to follow to the letter) Duncan Murdoch's "Building R for

Re: [Rd] Failure to build home-made package on WINDOWS 2000 professional

2006-09-11 Thread Uwe Ligges
Joost Schalken wrote: > Dear all, > > I am trying to build a home-made package (log2html) to > log R output to an HTML file. The package can be build > successfully under Solaris, however I am unable to build > the system under Windows 2000 Professional. > > I read (and tried to follow to the l

[Rd] problems in installing packages with R version 2.4.0 alpha (2006-09-05 r39134)

2006-09-11 Thread Richard M. Heiberger
I just downloaded the windows version R version 2.4.0 alpha (2006-09-05 r39134) 1. When I downloaded the packages, the following two were not found. > utils:::menuInstallPkgs() --- Please select a CRAN mirror for use in this session --- dependency ''fCalendar'' is not available dependency ''Spa

Re: [Rd] problems in installing packages with R version 2.4.0 alpha (2006-09-05 r39134)

2006-09-11 Thread Prof Brian Ripley
At least some of this will go away if you use a current version of 2.4.0 alpha rather than one that is a week old (as the posting guide does ask). We are now at r39258, and some of those binary packages were built against a substantially later version of 2.4.0 alpha. If you look at the list of

Re: [Rd] Failure to build home-made package on WINDOWS 2000 professional

2006-09-11 Thread miguel manese
Maybe you're doing bash . script.sh (i.e. source the script) ? M. Manese On 9/12/06, Uwe Ligges <[EMAIL PROTECTED]> wrote: > > > Joost Schalken wrote: > > Dear all, > > > > I am trying to build a home-made package (log2html) to > > log R output to an HTML file. The package can be build > > succ

[Rd] Readline bug (PR#9217)

2006-09-11 Thread kamila . naxerova
Full_Name: Kamila Naxerova Version: 2.3.1 OS: Windows XP Submission from: (NULL) (209.6.158.235) R crashes consistently when I use readline (i.e. I hold the arrow up button for a couple of seconds to go back to previous commands quickly). Thanks! platform i386-pc-mingw32 arch

[Rd] unexpected behaviour when defining a function

2006-09-11 Thread Deepayan Sarkar
Hi, I know S manuals used to warn against using the same names for a variable and a function, but I have never seen that cause problems in R, so I usually don't pay much attention to it. Which is why the following behaviour came as a surprise: > bar <- function() 1 > foo <- function(bar = bar())

[Rd] R Citation through time

2006-09-11 Thread Gregor Gorjanc
Hello! I keep my local bib file and up to now I had entry @Manual{R:2003, title = {R: A Language and Environment for Statistical Computing}, author = {{R Development Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {20

Re: [Rd] unexpected behaviour when defining a function

2006-09-11 Thread Gabor Grothendieck
You can't have x=x in an argument list. Try the following noting that we put a dot at the end of bar: > bar <- function() 1 > foo <- function(bar. = bar()) { + bar + } > foo() function() 1 > foo(bar = bar) function() 1 On 9/11/06, Deepayan Sarkar <[EMAIL PROTECTED]> wrote: > Hi, > > I know

Re: [Rd] unexpected behaviour when defining a function

2006-09-11 Thread Gabor Grothendieck
Sorry I forgot one of the dots. Here it is corrected: > bar <- function() 1 > foo <- function(bar. = bar()) { + bar. + } > foo() [1] 1 > foo(bar = bar) function() 1 On 9/12/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > You can't have x=x in an argument list. > > Try the following noti

Re: [Rd] unexpected behaviour when defining a function

2006-09-11 Thread Prof Brian Ripley
On Mon, 11 Sep 2006, Deepayan Sarkar wrote: > Hi, > > I know S manuals used to warn against using the same names for a > variable and a function, but I have never seen that cause problems in > R, so I usually don't pay much attention to it. But in this case you have a promise. (BTW, it can sti