Datum: Fri, 27 Jan 2012 09:06:44 -0800
Von: "Robert J. Hijmans" <r.hijmans at gmail.com>
An: Johannes Radinger <JRadinger at gmx.at>
Betreff: Re: kfold question
Johannes,
An error occurs when you request a kfold for a single observation. I will
fix that, but the request obviously makes no sense. It is straightforward
to count the number of observations by species with something like
table(data$species)
Best,
Robert
On Fri, Jan 27, 2012 at 1:56 AM, Johannes Radinger <JRadinger at gmx.at>
wrote:
Dear Mr Hijmans,
I tried to use your package dismo's function: kfold()
I want to split my dataset into 5 parts by species.
Of course it is not possible to split records of a species
with less the 5 observation into 5 parts... That is
the reason why I get a warning message...
It'd be okay when these species are devided by their maximum
number of records (1,2,3,4).
But somehow I also get an error message. I think that might
be related to that. Of course it doesn't make sense to
devide a species with 1 record by 1. Is this the reason
for the error message (sorry it is in German) or is it just something
totally different?
Fehler in rep(j, times = times[j]) : ung?ltiges 'times' Argument
Zus?tzlich: Warnmeldungen:
1: In kfold(occ.fish, k = 5, by = occ.fish$Species) :
lowered k for by group: N.Gesamt.Amerikanischer.Hundsfisch because the
number of observations was 4
2: In kfold(occ.fish, k = 5, by = occ.fish$Species) :
lowered k for by group: N.Gesamt.Flunder because the number of
observations was 3
3: In kfold(occ.fish, k = 5, by = occ.fish$Species) :
lowered k for by group: N.Juvenil.Flunder because the number of
observations was 1
...which would mean Error in rep(j, times = times[j]) : invalid 'times'
argument
How do you usually handle such datasets?Probably excluding these species
at all and subsetting the dataset (I have to think how to do that in R).
best regards,
johannes
--
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail