[Rd] extract function [ and empty index

2008-03-09 Thread Laurent Gautier
Dear list, I am having a question regarding the extract function [. The man page says that one usage with k-dimensional arrays is to specify k indices to [, with an empty index indicating that all entries in that dimension are selected. The question is the following: is there an R object

Re: [Rd] extract function [ and empty index

2008-03-09 Thread Gabor Grothendieck
Use TRUE. On Sun, Mar 9, 2008 at 5:05 AM, Laurent Gautier [EMAIL PROTECTED] wrote: Dear list, I am having a question regarding the extract function [. The man page says that one usage with k-dimensional arrays is to specify k indices to [, with an empty index indicating that all entries in

Re: [Rd] [patch] add=TRUE in plot.default()

2008-03-09 Thread Henrique Dallazuanna
I think you can use par(new = T) here: f - function(x) x^2 X - seq(0, 1, by=1/4) plot(f, col=blue) par(new = T) plot(X, f(X), col=red, type=l, xlab=, ylab=) On 09/03/2008, Andrew Clausen [EMAIL PROTECTED] wrote: Hi all, As long as I've used R, add=TRUE hasn't worked in contexts like this:

Re: [Rd] [patch] add=TRUE in plot.default()

2008-03-09 Thread Duncan Murdoch
On 08/03/2008 10:11 PM, Andrew Clausen wrote: Hi all, As long as I've used R, add=TRUE hasn't worked in contexts like this: f - function(x) x^2 X - seq(0, 1, by=1/4) plot(f, col=blue) plot(X, f(X), col=red, type=l, add=TRUE) I attached a fix for version 2.6.2.

Re: [Rd] extract function [ and empty index

2008-03-09 Thread Laurent Gautier
Thanks, I was forgetting the recycling rule. L. 2008/3/9, Gabor Grothendieck [EMAIL PROTECTED]: Use TRUE. On Sun, Mar 9, 2008 at 5:05 AM, Laurent Gautier [EMAIL PROTECTED] wrote: Dear list, I am having a question regarding the extract function [. The man page says that one

Re: [Rd] [patch] add=TRUE in plot.default()

2008-03-09 Thread Duncan Murdoch
On 09/03/2008 12:46 PM, Andrew Clausen wrote: Hi Duncan, On Sun, Mar 09, 2008 at 12:11:45PM -0400, Duncan Murdoch wrote: It has never been claimed that it would work, and as far as I can see, it doesn't make anything easier: the last line could be replaced by lines(X, f(X), col=red)

Re: [Rd] [patch] add=TRUE in plot.default()

2008-03-09 Thread Andrew Clausen
On Sun, Mar 09, 2008 at 04:04:08PM -0400, Duncan Murdoch wrote: Part of the reason I didn't like your patch is that it was incomplete: it didn't patch the plot.default.Rd file. Fair enough -- I wasn't sure whether I was fixing a bug or not. (... spreads the documentation around a bit.) That

Re: [Rd] [patch] add=TRUE in plot.default()

2008-03-09 Thread Gabor Grothendieck
On Sun, Mar 9, 2008 at 6:27 PM, hadley wickham [EMAIL PROTECTED] wrote: Yes. The ability to plot things on top of each other is important. The simplicity created by having a single interface for adding to plots outweighs the complexity of yet another parameter. The add parameter

Re: [Rd] [patch] add=TRUE in plot.default()

2008-03-09 Thread hadley wickham
But what about when the new data is outside the range of the current plot? plot/lines/points already works that way so this is just an interface issue. That may be the way it is, but I don't see how you could argue that it's desirable behaviour. Hadley -- http://had.co.nz/

Re: [Rd] [patch] add=TRUE in plot.default()

2008-03-09 Thread Gabor Grothendieck
Its not a matter of desirable or not -- its a matter that its a different point. The par(new= ) to get an old graph is completely confusing and its annoying that one has to suddenly switch to lines and points and cannot consistently use plot. That remains true whether or not there is auto

[Rd] source(echo=TRUE) bug (was: [R] source() behavior I don't understand) (PR#10923)

2008-03-09 Thread murdoch
On 09/03/2008 10:01 PM, Richard M. Heiberger wrote: temp.ttt - ttt - 1\nttt conn.ttt - textConnection(temp.ttt) source(conn.ttt, echo=TRUE) ## name of variable is echoed close(conn.ttt) cat(file=c:/temp/temp.R, temp.ttt) ## name of variable not echoed source(c:/temp/temp.R, echo=TRUE)

Re: [Rd] source(echo=TRUE) bug (was: [R] source() (PR#10924)

2008-03-09 Thread rmh
Thanks Duncan, While there, can you give a new optional argument that will permit the echo of blanks and comments? Rich __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel