rspatial / geodata

download geographic data
GNU General Public License v3.0
147 stars 15 forks source link

Corrupted `cmip6_files.txt` in `.check_cmip6` #33

Closed davidorme closed 1 year ago

davidorme commented 1 year ago

I'm running a GIS practical using geodata and had an odd issue crop up twice - once myself during testing and once from a student. The cmip6_files.txt file used in .check_cmip6 somehow got truncated: I don't know the mechanism by which this happened but the resulting empty file then causes the cmip6_* commands to fail with:

utils::read.table(tmpfile, sep = "_") :

Of course the ideal solution is to find out what truncated it - I don't think it is anything I or the student did as it is quite an obscure file to accidentally truncate - but maybe .check_cmip6 could defensively wrap the file load in a try statement?

https://github.com/rspatial/geodata/blob/35c7cc8ed35d3b19df16fedbe0ba1e2c410b0a1a/R/worldclim.R#L184-L195

rhijmans commented 1 year ago

Thank you. Changed as suggested.