From a previous question on the R-list, I saw two approaches for examining packages that are loaded in:
ls("package:ts")
lsf.str("package:ts")
In my case, I want to examine what the output of kmeans is, which is a function in the stats package, so I used:
lsf.str("package:stats")
However, I don’t know how to examine what is returned from this command. I want to identify the parameters used in a previous clustering, so that I can apply them to another dataset. Where I can find the parameters that are stored as part of this function?
The Value section of the
kmeanshelp page lists the format of the object returned byt he function :In general you can also list these values directly from your
kmeansobject with thenamesfunction :From the description of the values in the help page, I would say that the parameters used for the clustering are not stored in the resulting object. So if you only have access to the resulting
kmeansobject and not to the original function call, I would say that these parameters are lost, unfortunately…