courtiol / IsoriX

This is the website dedicated to the development of the R package IsoriX
12 stars 5 forks source link

Improve getprecip() #148

Closed courtiol closed 9 months ago

courtiol commented 1 year ago

For getprecip() to work one must do:

old_opt <- options(timeout = 500) ## modify R options
getprecip(path = "input/")
options(old_opt) ## restore original R options

This is a little clunky and not obvious since the error message due to an abort after 60s does not show up in RStudio. So either the function should check the options before running or it should change the options. Alternatively, perhaps there is a way to directly control that in the inner function used for the download.

courtiol commented 1 year ago

Another issue is that if the final "/" is missing the saving is garbled. Also it would be better if the path included the file names as in getelev(). We could also allow for the choice in resolution. Or perhaps we should rely on an external package to get these data as we did for elevation.