Re: [R] alias for a class

From: <cgenolin_at_u-paris10.fr>
Date: Fri, 14 Mar 2008 11:42:37 +0100

> Not easily.

Ok

> So you could probably write a function that tracked down and copied
> all the pieces, but it's not easy.

brrrr. Well, you're right, it's not worth it.

So I will define a class ClusterizLongData then a constructor

cld <- clusterizLongData <- function(){new("ClusterizLongData")}

Christophe

>> With function, we can do
>>
>> mcf <- myCoolFunction <- function(x)....
>>
> That creates a new function which is a copy of the old one. If one
> of them changes later, the other won't change, so it's not really an
> "alias".
>
> The trouble with trying to do this with classes is that a class isn't
> a simple thing in R. In S3, it's just a name that can be used in
> lots of places. S4 is more structured, but still a class definition
> is fairly spread out.
>
> So you could probably write a function that tracked down and copied
> all the pieces, but it's not easy.
>> With class, I define "clusterizedLongData", I want to use it with
>> the full name when I am writing my code, but I would like something
>> like cld when I make a demo, or when I try things on console... Is
>> it possible ?
>
> Isn't it really the job of your text editor to make it easy to type
> well chosen names? The GUIs in Windows and on the Mac can do name
> completion, so you don't need a lot more typing for the long name
> than the short one. As far as I know ESS can do the same, and there
> are probably others too. If you're not using one of those, you
> should be.
>
> Duncan Murdoch
>



Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 14 Mar 2008 - 10:48:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 14 Mar 2008 - 11:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive