Skip to content

Plots with k-means

4 messages · David Winsemius, Iuri Gavronski, eduardo san miguel

#
I send r-code in an attached file.

2009/11/2 Iuri Gavronski <iuri at proxima.adm.br>:
eduardosanmi at gmail.com>
segments(Pcoords_objetoC[nrow(Pcoords_objetoC),1],Pcoords_objetoC[nrow(Pcoords_objetoC),2],
))),matrix(seq(1:nrow(clusterPOI at objeto))))
#
The attached file did not come through to the list. I think you have  
some non-standard characters (or at least non-standard in my locale).  
I was able to get the code to run after using the Zap Gremlins  
function in TextWrangler. Prior to that "treatment" pretty much every  
line threw an error of this sort:

 > setClass(Class = 'POI',
+        representation(matrizSim = 'matrix',cos.query.docs = 'vector',
Error: unexpected input in:
"setClass(Class = 'POI',
?"
 >      wordsInQuery = 'ANY',docs = 'matrix', objeto = 'matrix', objetoC
Error: unexpected input in "?"
 > = 'matrix',
Error: unexpected '=' in "="
 >      Pcoords = 'matrix', PcoordsFI = 'matrix', newPcoords = 'matrix',
Error: unexpected input in "?"
 > newcoords = 'numeric' ,
Error: unexpected ',' in "newcoords = 'numeric' ,"
 >      newcoords_1 = 'numeric',  M = 'numeric', poisTextCol =
Error: unexpected input in "?"

I also needed to remove a couple of spaces between function names and  
parentheses when these occurred at ends-of-lines. Attached is a  
working version as a .txt file (which should make it through the list- 
serv:

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kmeans.mapper.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091102/4637ca2c/attachment-0002.txt>
-------------- next part --------------



--  
David.
 > sessionInfo()
R version 2.10.0 Patched (2009-10-29 r50258)
x86_64-apple-darwin9.8.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] splines   stats     graphics  grDevices utils     datasets   
methods   base

other attached packages:
[1] rms_2.1-0       Hmisc_3.7-0     survival_2.35-7

loaded via a namespace (and not attached):
[1] cluster_1.12.1  grid_2.10.0     lattice_0.17-26
On Nov 2, 2009, at 3:43 PM, eduardo san miguel wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
#
Hello Iuri,

Code sent is a sample with basic functionality from the package I?m
due to send to CRAN. Final package allows inteactivity (dragging and
selecting points, zooming in/out fisheye effect, ...) and full
exploration of the hyperbolic-alike space simulated.

Example sent just give you a taste of the visual methaphor
implemented, as described in
http://www.antsearch.univ-tours.fr/publi/DacVenADMA2006.pdf

Plot generated with sample code allows you to analize the way kmeans
have worked. You are plotting every point in the sample and six groups
appear clearly (groups in the sample are so intragroup homogeneus that
in most cases you will see six points plotted).

Regards,

Eduardo San Miguel Martin
BI Consultant


2009/11/2 Iuri Gavronski <iuri at ufrgs.br>: