My simple problem is that when i run kmeans this give me different results
because if centers is a number, a random set of (distinct) rows in x is
chosen as the initial centres.

About me the problem is simple.

The question i ask you is if it possible that centers could be different
from number.
i.e. instead of indicate a number of center, could be possible indicate
different character lable to identify the cluster i want to obtain?

thk you



2007/3/29, Gavin Simpson <gavin.simpson@ucl.ac.uk>:
>
> On Thu, 2007-03-29 at 15:02 +0200, Sergio Della Franca wrote:
> > Dear R-Helpers,
> >
> > I read in the R documentation, about kmeans:
> >
> >   centers
> >
> > Either the number of clusters or a set of initial (distinct) cluster
> > centres. *If a number*, a random set of (distinct) rows in x is chosen
> as
> > the initial centres.
> > My question is: could it be possible that the centers are character and
> not
> > number?
>
> I think you misunderstand - centers is the number of clusters you want
> to partition your data into. How else would you specify the number of
> clusters other than by a number? So no, it has to be a numeric number.
>
> The alternative use of centers is to provide known starting points for
> the algorithm, such as from the results of a hierarchical cluster
> analysis, that are the locations of the cluster centroids, for each
> cluster, on each of the feature variables.
>
> Also, argument x to kmeans() is specific about requiring a numeric
> matrix (or something coercible to one), so characters here are not
> allowed either.
>
> But then again, I may not have understood what it is that you are
> asking, but that is not surprising given that you have not provided an
> example of what you are trying to do, and how you tried to do it but
> failed.
>
> > and provide commented, minimal, self-contained, reproducible code.
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> G
> --
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> Gavin Simpson                 [t] +44 (0)20 7679 0522
> ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
> Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
> Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
> UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>
>

	[[alternative HTML version deleted]]

