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 ?
C
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 tw
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"),
>conta
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
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: r-devel@r-pro
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 off
Hi Tim
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
Hi,
One way of doing object-oriented programming in R is to use function
environment to hold object's data, see for example
@Article{Rnews:Chambers+Lang:2001a,
author = {John M. Chambers and Duncan Temple Lang},
title= {Object-Oriented Programming in {R}},
journal = {R Ne
>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 t
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: ..
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 in
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 ar
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 prot
(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 modu
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, Ro
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,
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
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, parent.fr
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))
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
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 h
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
>
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
23 matches
Mail list logo