Re: [R] Drawing rectangles in multiple panels

2007-07-17 Thread Stephen Tucker
Thanks very much, Gabor - I hadn't considered this possibility. I always enjoy your posts! --- Gabor Grothendieck [EMAIL PROTECTED] wrote: Suppose ri were already defined as in the example below. Then panel.qrect is a bit harder to define although with work its possible as shown below:

Re: [R] Drawing rectangles in multiple panels

2007-07-17 Thread Stephen Tucker
Hi Deepayan, that's very hard-core... for the atmospheric science applications (which is what I do) that I've encountered, (time-series) data sets are often pre-aggregated before distribution (to 'average out' instrument noise) so I haven't had the need for such requirements thus far... but very

Re: [R] Drawing rectangles in multiple panels

2007-07-14 Thread Stephen Tucker
I wonder what kind of objects? Are there large advantages for allowing lattice functions to operate on objects other than data frames - I couldn't find any screenshots of flowViz but I imagine those objects would probably be list of arrays and such? I tend to think of mapply() [and more recently

Re: [R] Drawing rectangles in multiple panels

2007-07-14 Thread Stephen Tucker
This is very interesting - but I'm not entirely clear on your last statement though about how existing functions can cause problems with the scoping that createWrapper() avoids... (but thanks for the tip). --- Gabor Grothendieck [EMAIL PROTECTED] wrote: Your approach of using closures is

Re: [R] Drawing rectangles in multiple panels

2007-07-14 Thread Deepayan Sarkar
On 7/14/07, Stephen Tucker [EMAIL PROTECTED] wrote: I wonder what kind of objects? Are there large advantages for allowing lattice functions to operate on objects other than data frames - I couldn't find any screenshots of flowViz but I imagine those objects would probably be list of arrays

Re: [R] Drawing rectangles in multiple panels

2007-07-14 Thread Gabor Grothendieck
Suppose ri were already defined as in the example below. Then panel.qrect is a bit harder to define although with work its possible as shown below: rectInfo - list(matrix(runif(4), 2, 2), matrix(runif(4), 2, 2), matrix(runif(4), 2, 2)) ri - function(x, y, ..., rect.info) {

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread deepayan . sarkar
On 7/11/07, Jonathan Williams [EMAIL PROTECTED] wrote: Hi folks, I'm having some trouble understanding the intricacies of panel functions. I wish to create three side-by-side graphs, each with different data-- so far, so good: I rbind() the data, add a column of subscripts as a conditioning

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Jonathan Williams
Deepayan, Thanks for the clarification. The rectangles are completely external to the panel data, and correspond to 90% confidence intervals built from training data, to be overlaid on these graphs of the test data. - Jonathan At 10:04 AM 7/11/2007, you wrote: On 7/11/07, Jonathan Williams

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Bert Gunter
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 10:04 AM To: Jonathan Williams Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Drawing rectangles in multiple panels On 7/11/07, Jonathan Williams [EMAIL PROTECTED] wrote: Hi folks

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread deepayan . sarkar
On 7/11/07, Bert Gunter [EMAIL PROTECTED] wrote: Deepayan et. al.: A question/comment: I have usually found that the subscripts argument is what I need when passing *external* information into the panel function, for example, when I wish to add results from a fit done external to the trellis

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread deepayan . sarkar
On 7/11/07, Jonathan Williams [EMAIL PROTECTED] wrote: Deepayan, Thanks for the clarification. The rectangles are completely external to the panel data, and correspond to 90% confidence intervals built from training data, to be overlaid on these graphs of the test data. Right. So if you

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
A question/comment: I have usually found that the subscripts argument is what I need when passing *external* information into the panel function, for example, when I wish to add results from a fit done external to the trellis call. Fits[subscripts] gives me the fits (or whatever) I want to

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Deepayan Sarkar
On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote: A question/comment: I have usually found that the subscripts argument is what I need when passing *external* information into the panel function, for example, when I wish to add results from a fit done external to the trellis call.

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Stephen Tucker
Not that Trellis/lattice was entirely easy to learn at first. :) I've been playing around with ggplot2 and there is a plot()-like wrapper for building a quick plot [incidentally, called qplot()], but otherwise it's my understanding that you superpose elements (incrementally) to build up to the

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Stephen Tucker
In the Trellis approach, another way (I like) to deal with multiple pieces of external data sources is to 'attach' them to panel functions through lexical closures. For instance... rectInfo - list(matrix(runif(4), 2, 2), matrix(runif(4), 2, 2), matrix(runif(4), 2, 2))

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Deepayan Sarkar
On 7/11/07, Stephen Tucker [EMAIL PROTECTED] wrote: In the Trellis approach, another way (I like) to deal with multiple pieces of external data sources is to 'attach' them to panel functions through lexical closures. For instance... rectInfo - list(matrix(runif(4), 2, 2),

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Gabor Grothendieck
Your approach of using closures is cleaner than that given below but just for comparison in: http://tolstoy.newcastle.edu.au/R/devel/06/03/4476.html there is a createWrapper function which creates a new function based on the function passed as its first argument by using the components of the

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Stephen Tucker
Regarding this, I meant to imply that lattice was similarly flexible in the sense of handing multiple data sets [IMHO], in regards to other aspects of the 'grammar of graphics' I have no qualifications to justify comment. But the idea and intuitiveness of graph construction in ggplot2 is very

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote: A question/comment: I have usually found that the subscripts argument is what I need when passing *external* information into the panel function, for example, when I wish to add

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Stephen Tucker [EMAIL PROTECTED] wrote: Not that Trellis/lattice was entirely easy to learn at first. :) I've been playing around with ggplot2 and there is a plot()-like wrapper for building a quick plot [incidentally, called qplot()], but otherwise it's my understanding that you

Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Stephen Tucker [EMAIL PROTECTED] wrote: In the Trellis approach, another way (I like) to deal with multiple pieces of external data sources is to 'attach' them to panel functions through lexical closures. For instance... rectInfo - list(matrix(runif(4), 2, 2),