Big-Biodiversity-Collaborative / SwallowtailClimateChange

Data and code for North American Swallowtail and larval host plant distributions in relation to climate change
BSD 2-Clause "Simplified" License
5 stars 0 forks source link

New CV approach #68

Closed ezylstra closed 1 year ago

ezylstra commented 1 year ago

Several steps:

ezylstra commented 1 year ago

In template, add logical to indicate whether or not to save ENMeval object with all models

ezylstra commented 1 year ago

@jcoliver I think the template-CV.R is about ready to go. One note: I didn't create or update a run_maxent() function like I did for all the other SDMs. I realized that we only run ENMevaluate once, since that does all the tuning and cross validation for us, and saves parameter estimates from a model that uses all the data. In my opinion, moving code from template-CV.R to a function just adds unncessary complications since we'd only call that function once. Let me know if you disagree.

I'll work on the script to run SDMs with all the data next.

jcoliver commented 1 year ago

All tasks completed for new CV approach, @ezylstra , but I'm leaving this open until I can do a few more tests on a bigger machine.

jcoliver commented 1 year ago

Seeing the warning [mask] CRS do not match ...anything to worry about?

ezylstra commented 1 year ago

Maybe. Sorry, I didn't run into that on my trial runs. Do you know where in the workflow that's popping up? And if it's only a couple species, which ones they are?

jcoliver commented 1 year ago

Just the one I've been testing things on (the Aegop-something). Don't know how widespread it is. Maybe due to updates or way the libraries loaded. Will do more research.

ezylstra commented 1 year ago

Ok - thanks. Happy to look at this in more detail tomorrow too.

jcoliver commented 1 year ago

Called (at least in one case) on:

pred_mask <- terra::mask(pred_mask, mcp)

The pred_mask object has CRS EPSG:4326, but mcp has no CRS. Might just be an issue with the shapefiles I have on my machine.

ezylstra commented 1 year ago

Ah, I think that might be it - good catch! I created all new filtered datasets, pa datasets, and shapefiles after updating those data scripts. So when I load an mcp shapefile on my machine, it does have a crs (EPSG:4326).

jcoliver commented 1 year ago

Good to go with this issue. I'll open a new one if the CRS warning remains.