Closed dblodgett-usgs closed 5 years ago
I see another problem with a file I can't share, but can also reproduce the same error with some rasterwise files:
fs <- list.files("../rasterwise", pattern = "nc$", full.names = TRUE, recursive = TRUE)
for (i in seq_along(fs)) nc_coord_var(fs[i])
#fs[i]
#[1] "../rasterwise/extdata/high-dim/test-1.nc"
nc_coord_var(f)
Error in if (grepl(lon_units, att_sub[["units"]], ignore.case = TRUE)) return("X") :
argument is of length zero
Each of these files raises the error:
"../rasterwise/extdata/high-dim/test-1.nc"
"../rasterwise/extdata/oscar_gdr_5d1993.nc"
"../rasterwise/extdata/rectilinear/CM2.1_regionmask.nc"
"../rasterwise/extdata/swapped/3A-DAY.nc"
"../rasterwise/extdata/timeseries.nc"
Sorry, I should have made another issue with this ... let me know what you prefer
This is the quick and dirty fix. From here we could add a little inference to deal with the "unknown" column in the response.