[R] cluster, mona error solved
Morten Mattingsdal
morten.mattingsdal at student.uib.no
Thu Jan 27 15:30:34 CET 2005
Sean Davis wrote:
>
> On Jan 27, 2005, at 9:06 AM, Morten Mattingsdal wrote:
>
>> Hi
>>
>> I have a problem using the package cluster on my binary data. I want
>> to try mona at first. But i get the an error.
>>
>> hc<-read.table("all.txt", header=TRUE, sep="\t", row.names=1)
>> srt(hc)
>> `data.frame': 51 obs. of 59 variables:
>> $ G1p : int 2 1 1 1 1 1 1 1 1 1 ...
>> $ G1q : int 1 1 1 1 1 1 1 1 1 1 ...
>> $ G2p : int 1 1 1 1 1 1 1 1 1 1 ...
>> $ G2q : int 1 1 1 1 1 1 1 1 1 1 ...
>> $ G3p : int 1 1 1 1 1 1 1 1 1 1 ...
>>
>> m<-mona(hc)
>> Error in mona(hc) : All variables must be binary (factor with 2 levels).
>>
>
> You have to be careful that the data are indeed each factors with 2
> levels (numeric variables with values 1 and 2 will not do). A summary
> of the data will tell you that.
>
> Sean
>
Yes. Now I understand. There was one single variable among my 59, which
did only have 1 level: I used summary(mydata) as you said:
and found
L16p
Min. :1
1st Qu.:1
Median :1
Mean :1
3rd Qu.:1
Max. :1
I removed this and now it workes fine.... thanks alot for your quick reply
regards
greatful morten
More information about the R-help
mailing list