prioritizr / aoh

Create Area of Habitat Data
https://prioritizr.github.io/aoh
9 stars 1 forks source link

create_spp_aoh_data bug? #44

Closed THChan11 closed 1 year ago

THChan11 commented 1 year ago

Was following the Git hub README.md instructions, upon executing:

# generate Area of Habitat data
## note that this function might take a complete because it will need to
## download the global habitat and elevation data that first time you run it.
spp_aoh_data <- create_spp_aoh_data(
  spp_info_data, output_dir = output_dir, cache_dir = cache_dir
)

when the following error was returned:

✔ initializing [31ms]
Error in get_zenodo_record(x, z, n_attempts = n_attempts) : 
  Error in result$doi : $ operator is invalid for atomic vectors
✖ importing global elevation data [11.5s]

this was done on macOS13.1, many thanks

jeffreyhanson commented 1 year ago

Hi @THChan11.

Thank you very much for reaching out!

I'm sorry, I'm not able to reproduce this bug on my system with the latest version on GitHub. This error message looks very similar to an issue that affected older versions of the package (due to issues with the Zenodo API), but this issue was resolved in more recent versions by simply scraping the relevant information from the Zenodo website.

Could you please do me a favour and try installing the latest version again, and see if that fixes it? This can be done with the following code:

remotes::install_github("prioritizr/aoh")

If that doesn't fix it, could you please post (1) the results of running traceback() after the error to provide more information on what's going wrong, and (2) your session information?

THChan11 commented 1 year ago

hi Jeff

The function downloads data smoothly after I have updated the package with your code

Previously I have been using 'devtools' instead of 'remotes' to update the package, which may have caused this problem.

Alternatively, the wifi from my host institution may have been blocking R from downloading IUCN data.

I am not sure which factor was the root cause but it works fine now, thank you very much for your help.

jeffreyhanson commented 1 year ago

Great! Glad to hear it's working now. No worries!