Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Wacek Kusnierczyk
Berwin A Turlach wrote: > >> foo = function(arg) arg$foo = foo >> >> e = new.env() >> foo(e) >> e$foo >> >> are you sure this is pass by value? >> > > But that is what environments are for, aren't they? might be. > And it is > documented behaviour. sure! > Read s

[Rd] Rd \usage clause for an S4 replace method

2009-03-13 Thread Sklyar, Oleg (London)
Given S4 methods [ and [<-, how do I write the Rd-file usage clause for the latter one? What I have now is: \S4method{[}{TimeSeries,TimeDate,missing}(x, i, j, ..., drop) \S4method{[<-}{TimeSeries,TimeDate,missing,ANY}(x, i, j, ..., value) which results in the following output: ## S4 method f

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Berwin A Turlach
On Fri, 13 Mar 2009 11:43:55 +0100 Wacek Kusnierczyk wrote: > Berwin A Turlach wrote: > > > And it is documented behaviour. > > sure! Glad to see that we agree on this. > > Read section 2.1.10 ("Environments") in the R > > Language Definition, > > haven't objected to that. i object to you

Re: [Rd] Rd \usage clause for an S4 replace method

2009-03-13 Thread Prof Brian Ripley
That's not how you use it, surely? The obvious to me \usage{ \S4method{[}{TimeSeries,TimeDate,missing}(x, i, j, ..., drop) \S4method{[}{TimeSeries,TimeDate,missing,ANY}(x, i, j, ...) <- value } works. There is an example of a replacement method using \method in 'Writing R Extensions', so expe

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Wacek Kusnierczyk
Berwin A Turlach wrote: > >> sure! >> > > Glad to see that we agree on this. > owe you a beer. > >>> Read section 2.1.10 ("Environments") in the R >>> Language Definition, >>> >> haven't objected to that. i object to your 'r uses pass by value', >> which is only partially corr

[Rd] Does anybody have some starter code in Java to instance a standalone JGRConsole ?

2009-03-13 Thread Daniel Kornhauser
Hi: Does anybody have some starter code in Java to instance a stand alone JGRConsole ? >From the docs it looks that it shouldn't be that hard to write some starter code: http://www.rosuda.org/r/nightly/javadoc/org/rosuda/JGR/JGRConsole.html But in practice starter code has always little tri

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread William Dunlap
Would it make anyone any happier if the manual said that the replacement functions should not be called in the form xNew <- `func<-` (xOld, value) and should only be used as func(xToBeChanged) <- value ? The explanation names(x) <- c("a","b") is equivalent to '*tmp*' <- x

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Tony Plate
Wacek Kusnierczyk wrote: [snip] i just can't get it why the manual does not manifestly explain what 'names<-' does, and leaves you doing the guesswork you suggest. I'm having trouble understanding the point of this discussion. Someone is calling a replacement function in a way that it's not

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Wacek Kusnierczyk
William Dunlap wrote: > Would it make anyone any happier if the manual said > that the replacement functions should not be called > in the form >xNew <- `func<-` (xOld, value) > and should only be used as >func(xToBeChanged) <- value > surely better than guesswork. > ? > > The explana

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Wacek Kusnierczyk
Tony Plate wrote: > Wacek Kusnierczyk wrote: >> [snip] >> i just can't get it why the manual does not manifestly explain what >> 'names<-' does, and leaves you doing the guesswork you suggest. >> >> > I'm having trouble understanding the point of this discussion. > Someone is calling a replacem

Re: [Rd] installed.packages and package info cache buglet (PR#13592)

2009-03-13 Thread maechler
> Mark Bravington > on Thu, 12 Mar 2009 21:45:18 +0100 (CET) writes: >> Looks like there is a buglet in 'installed.packages', around line 17: >> >> for (lib in lib.loc) { >> dest <- file.path(tempdir(), paste("libloc_", URLencode(lib,=20 >> TRUE), paste(fields

[Rd] lsfit w/ rank-deficient x

2009-03-13 Thread Vadim Ogranovich
Dear R-devel, It seems that lsfit incorrectly reports coefficients when the input matrix 'x' is rank-deficient, see the example below: ## here values of 'b' and 'c' are incorrectly swapped > x <- cbind(a=rnorm(100), b=0, c=rnorm(100)); y <- rnorm(100); lsfit(x, y)$coef Intercept a

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Tony Plate
Wacek Kusnierczyk wrote: Tony Plate wrote: Wacek Kusnierczyk wrote: [snip] i just can't get it why the manual does not manifestly explain what 'names<-' does, and leaves you doing the guesswork you suggest. I'm having trouble understanding the point of this discussion. Someo

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Wacek Kusnierczyk
Tony Plate wrote: > Wacek Kusnierczyk wrote: >> Tony Plate wrote: >> >>> Is there anything incorrect or missing in the help page for normal >>> usage of the replacement function for 'names'? (i.e., when used in an >>> expression like 'names(x) <- ...') >>> >> >> what is missing here in the

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Berwin A Turlach
On Fri, 13 Mar 2009 19:41:42 +0100 Wacek Kusnierczyk wrote: > > Glad to see that we agree on this. > > > > owe you a beer. O.k., if we ever meet is is first your shout and then mine. > >> haven't objected to that. i object to your 'r uses pass by value', > >> which is only partially corre

Re: [Rd] surprising behaviour of names<-

2009-03-13 Thread Wacek Kusnierczyk
Berwin A Turlach wrote: > On Fri, 13 Mar 2009 19:41:42 +0100 > Wacek Kusnierczyk wrote: > > > >> indeed, you said "R supposedly uses call-by-value (though we know how >> to circumvent that, don't we?)". >> >> in that vain, R supposedly can be used to do valid statistical >> computations (though