Martin Guetlein
2012-Jan-12 08:16 UTC
[R] problems with method ken.sto in package soil.spec: subscript out of bounds
Hi All, I would like to use Kennard-Stone algorithm for splitting a dataset.> mydata <- read.csv(url("http://www.ats.ucla.edu/stat/r/dae/binary.csv"))> library("soil.spec") > ken.sto(mydata,per.n=0.3)Error in ken.sto(mydata, per.n = 0.3) : subscript out of bounds I found that other people run into this problem as well: http://r.789695.n4.nabble.com/help-kennard-stone-algorithm-in-soil-spec-packages-does-not-work-for-my-dataset-td3031344.html The package maintainers email (Thomas Terhoeven-Urselmans) is apparently outdated, I already tried to send him an email. Any help would be very much appreciated, Best regards, Martin -- Dipl-Inf. Martin Gütlein Phone: +49 (0)761 203 8442 (office) +49 (0)177 623 9499 (mobile) Email: guetlein@informatik.uni-freiburg.de -- Dipl-Inf. Martin Gütlein Phone: +49 (0)761 203 8442 (office) +49 (0)177 623 9499 (mobile) Email: guetlein@informatik.uni-freiburg.de [[alternative HTML version deleted]]
rl.leonardo
2012-Jan-18 13:50 UTC
[R] problems with method ken.sto in package soil.spec: subscript out of bounds
Hi Martin, Certainly there are some problems with the "ken.sto" function.... In addition there are some considerations that you have to take into account before using this code. For instance, it projects the data onto a principal component space prior sampling. In this case you have to a PCA is really necessary for your data. Second, this function uses the Euclidean distance (ED) as metric for selecting the samples. By using the ED directly on the PCs, the PCs with high explained variance will ?dominate? the measurements. In this case is better to standardize the PCs prior ED computation or use the Mahalanobis distance. Whatever, I have modified the ?ken.sto? code and now seems to be that it works for your data ;-) . If you still need it just drop me an e-mail. Regards, Leonardo Ramirez-Lopez, Researcher Georges Lema?tre Centre for Earth and Climate Research Earth and Life Institute Universit? Catholique de Louvain, 3 Place Louis Pasteur 1348, Louvain la Neuve Belgium e-mail: leonardo.ramirez at uclouvain.be http://www.uclouvain.be/en-teclim.html Ph.D Researcher Physical Geography and Soil Science Institute of Geography University of T?bingen R?melinstr. 19-23 72070 T?bingen Germany http://www.geographie.uni-tuebingen.de/ -- View this message in context: http://r.789695.n4.nabble.com/problems-with-method-ken-sto-in-package-soil-spec-subscript-out-of-bounds-tp4288193p4306689.html Sent from the R help mailing list archive at Nabble.com.