Thank you very much in advance
Laura
=============================
EXAMPLE OF CODE
=============================
km = function(a,o) {
fld <- system.file("G:/ALRPC/JRC/IMG/", package="rgdal")
filename = as.name(paste (a, "-", o, sep=""))
file <- read.table(paste("R_out/", filename, ".txt", sep=""))
obj <- kmenas(file, 5)
sink(paste("R_out/res", filename, ".txt", sep=""))
"Kluster centers"
obj$centers
"Within size for clusters"
obj$withinss
"Cluster size"
obj$size
sink()
}
[[alternative HTML version deleted]]
______________________________________________
R-h...@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.
Your problem is that you forgot to print the objects in your function:
auto-printing only occurs at the top level.
--
Brian D. Ripley, rip...@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595