When you transform your data.frame into a matrix, all values become
characters, I don't think that is what you want... (moreover, you're
trying to compute distance with the "class" names as one of the
variables...)
The best would be to put your "Class" as row.names and then compute
your distances and hclust :
mm<Median[,1]
row.names(mm)<Median[,1]
Then you can compute the euclidean di

Here :
class Point{
int x;
int y;
.....
.....
public double distance(int x, int y) {
double d = Math.sqrt( Math.pow(x2x1, 2) + Math.pow(y2y1, 2)
); //ERROR IN THIS LINE
return distance; //ERROR HERE TOO...(2)
}
}
There is no x1,x2,y1,y2 defined in the class or in the method
parameter.
Swap it with the following line:
double d = Math.sqrt(

The problem is you haven't actually created your getter and setter
methods (specifically the getter methods). In Java, getter and setter
methods aren't automatically created for you; you have to explicitly
create them yourself. So, just add the following code:
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY()

The first bit is easy enough. You want to build up a dictionary
containing file numbers, and the sum of the squares of the values for
each file number, something like this (untested) should do it:
fileVectors = {}
for wordDict in myDict.itervalues():
for fileNumber, wordCount in wordDict.iteritems():
fileVectors[fileNumber] = fileVectors.get(fileNumber, 0) +
(wordCount ** 2)

Let's set up a coordinate system where the hex with coordinates (i,j)
is adjacent to (i1,j), (i1,j+1), (i,j1), (i,j+1), (i+1,j1),
(i+1,j).
(0,3) (2,2) (4,1)
(1,2) (3,1)
(0,2) (2,1) (4,0)
(1,1) (3,0)
(0,1) (2,0)
(1,0)
(0,0)
I'm going to apply a shear transform so that I can draw hex grids
compactly with ASCII art. The transformed 7
