[R] help! kennard-stone algorithm in soil.spec packages does not work for my dataset!!!

bbslover dluthm at yeah.net
Mon Nov 8 00:53:52 CET 2010


http://r.789695.n4.nabble.com/file/n3031344/RSV.Rdata RSV.Rdata 
I want to split my dataset to training set and test set using
kennard-stone(KS) algorithm, it is lucky there is R packages soil.spec to
implement it.

but when I used it to my dataset, it does not work, who can help me, how
reasons is it, below, it is my code, and my data in the attachment.

ks<-ken.sto(x,per="TRUE",per.n=0.3,va="FALSE",sav="FALSE")
ks

% results

$`Chosen sample names`
NULL

$`Chosen row number`
integer(0)

$`Chosen calibration sample names`
[1] "NULL"

$`Chosen calibration row number`
[1] "NULL"

$`Chosen validation sample names`
[1] "NULL"

$`Chosen validation row number`
[1] "NULL"

attr(,"class")

why it is all NULL ?


and

> ks<-ken.sto(x,per="TRUE",per.n=0.3,va="TRUE",sav="FALSE")
Error in val.min[i] <- blub[sample(length(blub), 1)] : 
  replacement has length zero
In addition: Warning message:
In min(prco[-cal.start.n, i]) :
  no non-missing arguments to min; returning Inf

if I set va="TRUE", appearing the errors.

I hope some friends can help me !
-- 
View this message in context: http://r.789695.n4.nabble.com/help-kennard-stone-algorithm-in-soil-spec-packages-does-not-work-for-my-dataset-tp3031344p3031344.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list