brshipley / megaSDM

Other
22 stars 3 forks source link

Could I put the maxent prediction results into the function dispersalRate? #5

Closed PetiteTong closed 1 year ago

PetiteTong commented 1 year ago

Dear Ben, When I put my result in function dispersalRate(I create a file just the same folder as the case), I got an error about TimeMaps, I dont's know how could I deal with this error.

Hope for your answers. best wishes!

PetiteTong

brshipley commented 1 year ago

Hello,

Thanks for your question! Would you mind sending me a screenshot of the error and the code you ran for the dispersalRate function?

Ben

PetiteTong commented 1 year ago

OK. error in Curyear - time_periods[y-1]: non-numeric argument to binary operator

BUG pg

brshipley commented 1 year ago

Thank you! I think the problem might be with the "current" time period in the "time_periods" object. If you want to include dispersal rate information, all of the time periods must be numbers. So, for example, if the "current" time period corresponds to 2020 (or -70 years BP if you're going backwards in time), use that instead of "current". If you don't have information on the dispersal rate of the species you can definitely skip the dispersal rate step without any problems as well.

Hope this helps! Let me know if you're still getting errors. Ben

PetiteTong commented 1 year ago

Ok, thanks a lot. I will try later.

PetiteTong commented 1 year ago

Hi, Ben, I changed the current to 2000,but it stil not work. like this

bug

I will try again, because I find the 2000_data is '.grd', I will try '.bil' again

Oooh,it's still not ok.

brshipley commented 1 year ago

Hello, and sorry for taking so long to get back to you. Have you tried removing the quotations marks around the the numbers? So, time_periods <- c(2000, 4160, 81100) instead of time_periods <- c('2000', '4160', '81100')?

Ben

PetiteTong commented 1 year ago

yes, I tried it. It's ok.

Thanks a lot