From tal.galili at gmail.com  Mon Jun  8 20:55:17 2015
From: tal.galili at gmail.com (Tal Galili)
Date: Mon, 8 Jun 2015 21:55:17 +0300
Subject: [Rd] Request: making cutree S3 in R?
In-Reply-To: <CAAHES9z9VmgF8K6e1Ls1PnKhJ4fw1ph2pvdTv0GHcGDiBsPNKw@mail.gmail.com>
References: <CANdJ3dWW3xd4-oWgN4AAdKe_q6RyqVhM=-B40Avc=F3FdcSevQ@mail.gmail.com>
	<CAAHES9z9VmgF8K6e1Ls1PnKhJ4fw1ph2pvdTv0GHcGDiBsPNKw@mail.gmail.com>
Message-ID: <CANdJ3dVa5QJMkF8Vg8USwnfoa0MyfCNPA=MQv7UqsOd400EpeQ@mail.gmail.com>

Hi Gavin,
Thank you for the e-mail, I have already done so in:
https://github.com/talgalili/dendextend/blob/master/R/cutree.dendrogram.R

I wrote this e-mail since I understand that long term we would like to
avoid having packages override functions from base R packages. So since I
am extending cutree for dendrogram, it would have been nice if the current
function would have been S3, so that I wouldn't need to override it the way
I do.

Best,
Tal



----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili at gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------


On Mon, Jun 8, 2015 at 7:24 PM, Gavin Simpson <ucfagls at gmail.com> wrote:

> In lieu of that Tal, why not do as Writing R Extensions illustrates and
> add the following to your package
>
>
> On 6 June 2015 at 04:44, Tal Galili <tal.galili at gmail.com> wrote:
>
>> Hello all,
>>
>> A question/suggestion:
>>
>> I was wondering if there is a chance of changing stats::cutree to be S3
>> and
>> use cutree.hclust?
>>
>> For example:
>>
>> cutree <- function(tree, k = NULL, h = NULL,...)
>> {
>>   UseMethod("cutree")
>> }
>>
>> cutree.hclust <- stats::cutree
>> # This will obviously need the actual content of stats::cutree
>>
>>
>> This would be nicer for people like me to add new methods to cutree. For
>> example the cutree.dendrogram function
>> <
>> https://github.com/talgalili/dendextend/blob/master/R/cutree.dendrogram.R>
>> I
>> implemented in dendextend,
>>
>>
>>
>> With regards,
>> Tal
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>
>
> --
> Gavin Simpson, PhD
>

	[[alternative HTML version deleted]]



[Rd] Request: making cutree S3 in R?
Tal Galili