Skip to content
Prev 361371 / 398503 Next

Training set in Self organizing Map

Hi Elahe,

if you look at your subdf, you will see that the column Country - which is
not numeric - is still present. You might have other non-number columns,
but this I cannot tell.

scale expects a numeric matrix. You give it a data.frame which is silently
cast to a matrix. A matrix can only have one type - unlike the data.frame -
so the presence of the non-numeric columns results in a matrix of type
character. Calculating means of characters is not possible, hence the error.

You need your data.frame to consist only of numeric types - then scale will
proceed without complaints.

Best wishes,
Ulrik



On Wed, 1 Jun 2016 at 16:41 ch.elahe via R-help <r-help at r-project.org>
wrote: