[Rd] S4 : declaration of inheritance

2008-02-25 Thread christophe . genolini
Hi the list, There is two way to declare a new object with inheritence : one can do setMethod(myClass, representation(fatherClass,x=numeric) or setMethod(myClass, representation(x=numeric), containt=fatherClass Is there any difference ? What is the usal way ? Christophe

Re: [Rd] S4 : declaration of inheritance

2008-02-25 Thread Oleg Sklyar
setClass(myClass, representation(x=numeric), contains=fartherClass) seems more logical to me in sense of syntax (pay attention to setClass instead of setMethod and contains instead of containt), but both work apparently. Oleg [EMAIL PROTECTED] wrote: Hi the list, There is two way to

Re: [Rd] S4 : declaration of inheritance

2008-02-25 Thread christophe . genolini
Sorry, I make a mistake... I meant : what the difference between setClass(myClass, representation(fatherClass,x=numeric) or setClass(myClass, representation(x=numeric), contains=fatherClass setClass(myClass, representation(x=numeric), contains=fartherClass)

Re: [Rd] Standard method for S4 object

2008-02-25 Thread Tim Hesterberg
It depends on what the object is to be used for. If you want users to be able to operate with the object as if it were a normal vector, to do things like mean(x), cos(x), etc. then the list would be very long indeed; for example, there are 225 methods for the S4 'bdVector' class (in S-PLUS), plus

Re: [Rd] Calling R_PreserveObject from embedded R

2008-02-25 Thread Martin Rubi
Hi Laurent, with your comments I was able to find the problem in no time. It was my code that was doing something wrong, now it's fixed. Thank you very much for your response. best regards martin - Original Message - From: Laurent Gautier To: [EMAIL PROTECTED] Cc:

[Rd] New version of X11, png and jpeg

2008-02-25 Thread Prof Brian Ripley
R-devel has new versions of the X11(), png() and jpeg() devices on Unix-alikes. The intention is that these are used identically to the previous versions (which remain available) but will produce higher-quality output with more features. Pros: Antialiasing of text and lines (can be turned

Re: [Rd] Standard method for S4 object

2008-02-25 Thread Tim Hesterberg
Tim Hesterberg wrote: It depends on what the object is to be used for. If you want users to be able to operate with the object as if it were a normal vector, to do things like mean(x), cos(x), etc. then the list would be very long indeed; for example, there are 225 methods for the S4

[Rd] r44608 fails make check-all in scatter.smooth example

2008-02-25 Thread Gavin Simpson
Dear List, Having had my appetite sufficiently whetted by Prof. Ripley's email about the new graphics capabilities in Unixes, I wanted to try them out. I updated to svn r44608, configured with the following options: R is now configured for x86_64-unknown-linux-gnu Source directory:

Re: [Rd] Standard method for S4 object

2008-02-25 Thread Oleg Sklyar
Hi Tim, well, I am not arguing that there are situation when one needs to rewrite everything from scratch. However it is always worth at least considering inheritance if there is a candidate to inherit from. It saves a lot of work. Anyway, your examples of S3 class usage are obviously valid

Re: [Rd] Standard method for S4 object

2008-02-25 Thread Tim Hesterberg
Hi Oleg, If there as a class to inherit from, then my point about an S4 class requiring lots of methods is moot. I think it would come down then to whether one prefers flexibility (advantage S3) or a definite structure for use with C/C++ (advantage S4). Tim well, I am not arguing that there

Re: [Rd] how to write dput-able objects

2008-02-25 Thread Gabor Grothendieck
You might want to look at the proto package. proto objects won't immediately dput either but it would not be hard to convert them to restorable character strings because the proto methods normally have their object as their parent environment so its implicit in the definition. First define a

Re: [Rd] New version of X11, png and jpeg

2008-02-25 Thread Roger Peng
(Apologies, I meant to 'Reply to all' the first time but forgot). I built r44608 of R-devel with (I think) cairo support. At least, that's what the configure script told me. In addition, 'capabilities(cairo)' is TRUE. Calling X11(type = Cairo) gives me the error: Error in X11() : X11 module

Re: [Rd] New version of X11, png and jpeg

2008-02-25 Thread Prof Brian Ripley
That call is from Cairo 1.2, so looks like our test FC5 box had a later version of the cairo libraries than the one pkg-config reported. You should be able to build with --without-cairo until such a time as we can add a suitable configure test. Thank you for the report. On Mon, 25 Feb 2008,

Re: [Rd] r44608 fails make check-all in scatter.smooth example

2008-02-25 Thread Prof Brian Ripley
The cause is this: r44607 | maechler | 2008-02-25 14:01:52 + (Mon, 25 Feb 2008) | 2 lines add Fortran type declarations in two cases, mainly for didactical reasons The two declarations have been interchanged. Fixed in 44609, I hope. On Mon, 25 Feb 2008, Gavin Simpson wrote: Dear List,

Re: [Rd] how to write dput-able objects

2008-02-25 Thread Vadim Organovich
Thank you Gabor! This is very close indeed to what I need. If dput() were generic one could code dput.proto() and that would be it. Anyway, it is so close to what I need that I should be able to hack someting to make it work for my purposes. Thanks again! Vadim

Re: [Rd] how to write dput-able objects

2008-02-25 Thread Gabor Grothendieck
Try something like this. If ..Name exists in the proto object it uses that as the name; otherwise, it uses the name.proto() heuristic to find the name. library(proto) dput.proto - function(x, ...) { y - as.list(x, all = TRUE) if (!exists(..Name, x)) y$..Name - name.proto(x,

Re: [Rd] Clipping using par(plt=..., xpd=FALSE) inconsistencies

2008-02-25 Thread Prof Brian Ripley
The following works in R-devel x - rnorm(1000) hist(x, xlim=c(-4,4)) usr - par(usr) clip(usr[1], -2, usr[3], usr[4]) hist(x, col = 'red', add = TRUE) clip(2, usr[2], usr[3], usr[4]) hist(x, col = 'blue', add = TRUE) do.call(clip, as.list(usr)) #

Re: [Rd] r44608 fails make check-all in scatter.smooth example

2008-02-25 Thread Gavin Simpson
On Mon, 2008-02-25 at 19:10 +, Prof Brian Ripley wrote: The cause is this: r44607 | maechler | 2008-02-25 14:01:52 + (Mon, 25 Feb 2008) | 2 lines add Fortran type declarations in two cases, mainly for didactical reasons The two declarations have been interchanged. Fixed in

Re: [Rd] r44608 fails make check-all in scatter.smooth example

2008-02-25 Thread Peter Dalgaard
Gavin Simpson wrote: On Mon, 2008-02-25 at 19:10 +, Prof Brian Ripley wrote: The cause is this: r44607 | maechler | 2008-02-25 14:01:52 + (Mon, 25 Feb 2008) | 2 lines add Fortran type declarations in two cases, mainly for didactical reasons The two declarations have been

Re: [Rd] New version of X11, png and jpeg

2008-02-25 Thread Michael Lawrence
On Mon, Feb 25, 2008 at 10:56 AM, Prof Brian Ripley [EMAIL PROTECTED] wrote: R-devel has new versions of the X11(), png() and jpeg() devices on Unix-alikes. The intention is that these are used identically to the previous versions (which remain available) but will produce higher-quality

Re: [Rd] New version of X11, png and jpeg

2008-02-25 Thread Prof Brian Ripley
Michael, Would it be at all feasible to make the cairo backend available on all platforms and have it provide a public API through which an arbitrary cairo context could be passed as the drawing target? Offering an API is something I have considered for the TODO for 2.8.0. However, we are at