Kmeans                 package:amap                 R Documentation

_K-_M_e_a_n_s _C_l_u_s_t_e_r_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     Perform k-means clustering on a data matrix.

_U_s_a_g_e:

     Kmeans(x, centers, iter.max = 10, nstart = 1,
              method = "euclidean")

_A_r_g_u_m_e_n_t_s:

       x: A numeric matrix of data, or an object that can be coerced to
          such a matrix (such as a numeric vector or a data frame with
          all numeric columns). 

 centers: Either the number of clusters or a set of initial cluster
          centers. If the first, a random set of rows in 'x' are chosen
          as the initial centers. 

iter.max: The maximum number of iterations allowed. 

  nstart: If 'centers' is a number, how many random sets should be
          chosen?

  method: the distance measure to be used. This must be one of
          '"euclidean"', '"maximum"', '"manhattan"', '"canberra"',
          '"binary"', '"pearson"' or '"correlation"'. Any unambiguous
          substring can be given.

_D_e_t_a_i_l_s:

     The data given by 'x' is clustered by the k-means algorithm. When
     this terminates, all cluster centres are at the mean of their
     Voronoi sets (the set of data points which are nearest to the
     cluster centre).

     The algorithm of Lloyd-Forgy is used; method="euclidean" should
     return same result as with function kmeans.

     An objective: to allow NA values.

_V_a_l_u_e:

     A list with components:

 cluster: A vector of integers indicating the cluster to which each
          point is allocated. 

 centers: A matrix of cluster centres.

withinss: The within-cluster sum of square distances for each cluster.

    size: The number of points in each cluster.

_S_e_e _A_l_s_o:

     'hcluster','kmeans'.

