fitzLab-AL / gdm

R package for Generalized Dissimilarity Modeling
GNU General Public License v3.0
33 stars 12 forks source link

predict error #28

Closed willright28 closed 2 years ago

willright28 commented 2 years ago

Hi @fitzLab-AL @mliskAL

I would like to make some predictions but got an error. I used two sets of factors in my gdm model,1) 19 bioclimate factors(original value) and 2) land cover data(range from 0~1). When I tried to make a prediction through time the result only had zero value, I checked whether this was brought out by having the same raster layer(i.e. climate or land cover not change) for the two time periods stack but the answer was not. I've had no problems with the gdm model using 19 bioclimate factors in the past. So I run two models with the same response data but using only climate or land cover data, this time the predict function worked well. So I cannot figure out why the function produces an error result when the two sets of factors are combined, they have the same resolution and extent, and different period stacks have the same order for factors.

Looking forward to your reply and thanks in advance.

fitzLab-AL commented 2 years ago

I am not able to explore this problem without a reproducible example.

willright28 commented 2 years ago

Hi @fitzLab-AL Thanks for your reply. Here I attach a reproducible example, please take a look.

example.zip

fitzLab-AL commented 2 years ago

The problem is with your raster data, not the function / package. The non-bioclimatic variables have a few rows of NAs.