[R] Kohonen Package
Peter Ehlers
ehlers at ucalgary.ca
Sun Nov 29 01:16:04 CET 2009
I haven't used pkg:kohonen, so this is just guessing:
1. are you using an old version of the package?
2. don't call the output of function som() 'som'. As
people around here might say: would you call your
iguana 'iguana'?
3. have you used str() on your object to check what
it really contains? I would guess that it should be
of class som and have a component 'distances'.
If none of that helps then it's beyond me.
-Peter Ehlers
Brock Tibert wrote:
> Hi All,
>
> I am still learning R, but making, IMO, great strides. I learned about Kohonen/Self-Organizing Maps in class and I would like to try to replicate some of the things we have seen in class.
>
> Below is my code. I am trying to create a u-matrix. In the documentation on page 9 it appears the type of plot, dist.neighbours should do the trick, however, I am getting an error:
> (Error in match.arg(type) : 'arg' should be one of "codes", "changes", "counts", "mapping", "property", "quality")
>
> Since I am new to R, I figure I am missing something obvious. Any help you can provide will be greatly appreciated!
>
> Thanks in advance,
>
> Brock
>
> library(kohonen)
>
> data("wines")
> wines.sc <- scale(wines)
>
> som <- som(wines.sc, grid=somgrid(5, 5, "hexagonal"))
> plot(som)
> plot(som, type="dist.neighbours" )
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
More information about the R-help
mailing list