I'm resending this bug report with a new example. As seen below,
cut.dendrogram gives an error message for some heights, but not for others
and with some datasets adn not others. I can't see why.
Last time I unwittingly sent my message with HTML formatting. This time I'm
travelling and using an e-mail system that I am unfamiliar with. As far as
I can see, I am not using HTML.
Best wishes,
Mikkel
> library(cluster)
> data(flower)
> dfl1 <- daisy(flower, type = list(asymm = 3))
> hdfl1<-hclust(dfl1,method="average")
> plot(hdfl1)
> ddfl1<-as.dendrogram(hdfl1)
> cdfl1<-cut(ddfl1,h=0.5)
> cdfl1<-cut(ddfl1,h=0.4)
> cdfl1<-cut(ddfl1,h=0.31312)
> cdfl1<-cut(ddfl1,h=0.31311)
Error: more elements supplied than there are to replace> cdfl1<-cut(ddfl1,h=0.2)
Error: more elements supplied than there are to replace> cdfl1<-cut(ddfl1,h=0.14179)
Error: more elements supplied than there are to replace> cdfl1<-cut(ddfl1,h=0.14178)
> cdfl1<-cut(ddfl1,h=0.1)
> ## but,
> dfl2 <- daisy(flower, type = list(asymm = c(1, 3), ordratio = 7))
> hdfl2<-hclust(dfl2,method="average")
> plot(hdfl2)
> ddfl2<-as.dendrogram(hdfl2)
> cdfl2<-cut(ddfl2,h=0.5)
> cdfl2<-cut(ddfl2,h=0.4)
> cdfl2<-cut(ddfl2,h=0.3)
> cdfl2<-cut(ddfl2,h=0.2)
> cdfl2<-cut(ddfl2,h=0.1)
>
--please do not edit the information below--
Version:
platform = i386-pc-mingw32
arch = i386
os = mingw32
system = i386, mingw32
status =
major = 1
minor = 5.0
year = 2002
month = 04
day = 29
language = R
Windows XP Professional (build 2600) Service Pack 0.0
Search Path:
.GlobalEnv, package:mva, package:cluster, package:ctest, Autoloads,
package:base
-----Original Message-----
From: Martin Maechler
To: Grum, Mikkel
Cc: Martin Maechler
Sent: 10/05/02 12:28
Subject: Re: cut.dendrogram
Dear Mikkel,
Thank you for your report,
but
could you re-"compile" this message to make it (more) useful as
bug report?
1) Please turn *off* the HTML-ification that your e-mail
software has used. It can make messages in the R-bugs archive
almost unusable (the same goes for attachments!)
2) Please use *complete* examples! I.e. you can't use an object
`x' that is only available to you.
Try to use R datasets -- via data(<...>) -- or construct them
explicitly. To do this, do dput(yourdata) if yourdata is
relatively small.
Otherwise generate random data such as
set.seed(532) # make it reproducible!
y <- rnorm(100)
mdat <- data.frame(x = 1:100, y = y, u = cut(y,3), v = y^2)
Thank you one more
Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To:
r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._