[R-sig-eco] SDM (MaxEnt) per Species, package dismo

Johannes Radinger JRadinger at gmx.at
Mon Jan 30 12:24:45 CET 2012


Hello SIG-ECO list,

I am want to perform Species Distribution Models with R's dismo
package (function: maxent()). Of course this topic is a spatial topic (R-SIG-GEO related) but I think it fits better to the ECO list.

For my analysis (MaxEnt)I have a Rasterstack of predictor variables and
the species occurence points as spatial points (sp-class).

My list of observations has several different species. And I divided
the list into a training and testing dataset with:
kfold(occ.points, k = 5, by = occ.points$Species)

As I read in the orig. MaxEnt tutorial, it should be possible to use an input file with multiple species. I'd like to know:
Does that accuatlly work also in the R-Maxent setup? Can a provide maxent() spatial points of different species, or do I have to fit the model manually for each species (resp. in a loop?) How can I access the results of the single species (like the 'me' in the examples of maxent).

Another maxent related question: What happens if one of the predictor rasters is not entirely populated with values resp. shows NA's? Are these cells just excluded from the model fit and prediction or will there be a problem with the entire model?

Thank you for your help,

Best regards,
Johannes


-------- Original-Nachricht --------
> 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
> >

-- 




--



More information about the R-sig-ecology mailing list