brshipley / megaSDM

Other
22 stars 3 forks source link

Vignette error in TrainStudyEnv #3

Closed ddenney1 closed 2 years ago

ddenney1 commented 2 years ago

I am really excited about this package! Thank you for making it available and for putting together a nice tutorial vignette. I am trying to run the tutorial, both with my data and the example data, but I receive an error with the TrainStudyEnv command.

As written, there isn't a command for the projection in the vignette example. I've been putting in the maxentproj = T command and also tried using the desiredCRS portion from the manual but none of these work.

The command in the vignette is:

TSEnv <- TrainStudyEnv(input_TA = input_TA, output = envoutput, clipTrain = c(-91.5, -75, 25.5, 36), clipStudy = c(-91.5, -75, 25.5, 36))

and I get the following error:

Error in if (proj4string(projto) == proj4string(projfrom)) { : missing value where TRUE/FALSE needed In addition: Warning message: In wkt(projto) : CRS object has no comment

brshipley commented 2 years ago

Hi!

Thank you so much! I just reviewed your error and realized that the last update I made to that function introduced a minor typo into it. I fixed the error and ran the code for a variety of cases, so if you redownload megaSDM it should work as planned now. However, if it is still not working for you, please contact me again so we can figure out the issue.

Thanks for your patience, Benjamin Shipley

ddenney1 commented 2 years ago

Thank you for the quick follow up! This worked and it is running beautifully. Thank you!