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

David Winsemius dwinsemius at comcast.net
Mon Nov 8 01:21:12 CET 2010


On Nov 7, 2010, at 6:53 PM, bbslover wrote:

>
> 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.

No attachment, athough partial credit for making the effort. Most  
probable cause... failing to read Posting Guide.

-- 
David.
>
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list