Hi Folks !

I' m quite new and unfamiliar to R and the rpy syntax --
I want to perform a hierarchical clustering via rpy

(org code is taken from here:
http://www.statmethods.net/advstats/cluster.html )

I've got my distance matrix:

data = [[  0.           6.00346208  14.73305254   9.45877593  10.37529392
   14.64073304   6.73684629   5.71299169  10.16587301   8.56850401
    5.85452253   6.75451708  12.3598735    8.56758694  16.77969395]
 [  6.00346208   0.          10.75255058   9.27694017   8.92864743
   10.47224298   8.33163063   3.03224224   6.23356535   2.85002526
    0.35475766  11.35605081   9.77946491   3.66622217  14.44358453]
 [ 14.73305254  10.75255058   0.           8.20798849   6.14347206
    0.57937984  10.93687071  11.69653816   8.92573409   9.30765642
   10.92201653  16.95097879  11.84454769   9.45838554   7.06646942]
 [  9.45877593   9.27694017   8.20798849   0.           2.07907528
    8.45596866   3.40937032   9.27393067   9.92154998   9.96574548
    9.30819585   9.61397821  12.45180007   9.87260158   9.46924733]
 [ 10.37529392   8.92864743   6.14347206   2.07907528   0.           
6.39730037
    5.12099971   9.28180209   8.84101318   9.05018105   9.01053528
   11.38155829  11.58042352   8.97908492   8.06535982]
 [ 14.64073304  10.47224298   0.57937984   8.45596866   6.39730037   0.
   11.06346718  11.43178368   8.73774422   8.95968309  10.64201137
   17.00645586  11.76744632   9.17201625   7.52501462]
 [  6.73684629   8.33163063  10.93687071   3.40937032   5.12099971
   11.06346718   0.           7.70853073  10.68474763   9.94520392
    8.26301531   6.30469627  13.26153547   9.98211461  12.58582   ]
 [  5.71299169   3.03224224  11.69653816   9.27393067   9.28180209
   11.43178368   7.70853073   0.           9.07422228   5.49794007
    2.69531742   9.67645849  12.69106934   6.59566115  16.014528  ]
 [ 10.16587301   6.23356535   8.92573409   9.92154998   8.84101318
    8.73774422  10.68474763   9.07422228   0.           4.29424883
    6.58392694  15.46759047   4.12940613   2.79381245  10.37719813]
 [  8.56850401   2.85002526   9.30765642   9.96574548   9.05018105
    8.95968309   9.94520392   5.49794007   4.29424883   0.           
3.15487702
   13.89075988   8.17914555   1.66774488  13.11107951]
 [  5.85452253   0.35475766  10.92201653   9.30819585   9.01053528
   10.64201137   8.26301531   2.69531742   6.58392694   3.15487702   0.
   11.1407002   10.12084428   4.01886974  14.6837326 ]
 [  6.75451708  11.35605081  16.95097879   9.61397821  11.38155829
   17.00645586   6.30469627   9.67645849  15.46759047  13.89075988
   11.1407002    0.          17.80463378  14.13215125  18.79282964]
 [ 12.3598735    9.77946491  11.84454769  12.45180007  11.58042352
   11.76744632  13.26153547  12.69106934   4.12940613   8.17914555
   10.12084428  17.80463378   0.           6.54836735  10.91815506]
 [  8.56758694   3.66622217   9.45838554   9.87260158   8.97908492
    9.17201625   9.98211461   6.59566115   2.79381245   1.66774488
    4.01886974  14.13215125   6.54836735   0.          12.34812994]
 [ 16.77969395  14.44358453   7.06646942   9.46924733   8.06535982
    7.52501462  12.58582     16.014528    10.37719813  13.11107951
   14.6837326   18.79282964  10.91815506  12.34812994   0.        ]]
(15, 15) shape
<class 'numpy.core.defmatrix.matrix'>


... and tried to cluster by using:

clustered =  r.hclust(data, method="single")

... but I receive:

rpy.RPy_RException: Error in if (n < 2) stop("must have n >= 2 objects 
to cluster") :
  argument is of length zero

I'm cant understand this error message  --  I've got 15!!! Objects ....

Maybe one of you could help.

Thanks and best regards in advance .

florian






------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to