> I want to use "domain" function to run species distribution model in R.
> I used "sp.occ.do<-domain(env.pre, pred_train, factors=c('continent')) &
> sp.occ.pre.pro<-predict(env.pre, sp.occ.do)" to predict species distribution.
> BUT, I got  "Error in domdist(object, ln[j], vals[, ln[j]]) : subscript out of
> bounds" and could not run the domain model.

> How can I solve this problem?


You could start by giving us enough information to help you.

What package did you get the domain() function from?

What do your data look like? str() and dim() are both useful
for describing data.

Can you provide a minimal workable example? dput() is one
option for providing data.

All we can tell you right now is that your data are in some
way the wrong size or shape.

Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to