[R] cluster- binary data.

Martin Maechler maechler at stat.math.ethz.ch
Wed May 21 17:03:27 CEST 2003

```>>>>> "Eryk" == Eryk Wolski <wolski at molgen.mpg.de>
>>>>>     on Wed, 21 May 2003 15:21:05 +0200 writes:

Eryk> Hi!
Eryk> I am trying to calculate a dissimilarity matrix using daisy.
Eryk> The matrix vectver is binary as i test with:
>> levels(as.factor(vectver))
Eryk> [1] "0" "1"

Eryk> But the call to daisy gives me the following error message.:

>> dfl1 <- daisy(vectver, type = list(asymm = c(1:length(vectver[,1]))))
Eryk> Error in daisy(vectver, type = list(asymm = c(1:length(vectver[, 1])))) :
Eryk> at least one binary variable has more than 2 levels.

Eryk> and the call to mona that.

Eryk> levels(as.factor(vectver))
Eryk> [1] "0" "1"
>> r<-mona(vectver)
Eryk> Error in mona(vectver) : All variables must be binary (factor with 2 levels).

Well, you really don't give enough information
(about the exact structure of `vectver').

Please make use of str(.), summary(.), table(.) ..

E.g., the following works flawlessly for me:

> vectver <- matrix(as.numeric(runif(10000) < 0.1), 200, 50)# more 0 than 1
> dv <- daisy(vectver, type = list(asymm = 1:ncol(vectver)))
> ##                                       ^^^^^^^^^^^^^^  Note !
> mv <- mona(vectver)

Eryk>
Eryk>    <........Eryk. ............>
Eryk>

Eryk> [[alternate HTML version deleted]]

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
this means that you should really configure your e-mail "software"
such that you send plain text only; see also
http://www.r-project.org/mail.html

Regards,

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

```

More information about the R-help mailing list