SantanderMetGroup / loadeR

A climate4R package for data access
https://github.com/SantanderMetGroup/climate4R
GNU General Public License v3.0
13 stars 13 forks source link

Error in loadStationData: object 'nc' not found #68

Open tubabucak opened 4 years ago

tubabucak commented 4 years ago

Dear all, Today after re-installing the packages and updating R, the following codes started to giving error: object 'nc' not found. I could not find the reason. Any help is appreciated.

library(loadeR) library(climate4R.datasets) library(visualizeR) library(VALUE) library(climate4R.value)

data("PRUDENCEregions", package = "visualizeR") bb <- PRUDENCEregions["IP"]@bbox lon <- bb[1,]; lat <- bb[2,] v86 <- file.path(find.package("VALUE"), "example_datasets","VALUE_ECA_86_v2.zip") y <- loadStationData(dataset = v86, var = "precip", lonLim = lon, latLim = lat, years = 1979:2008)

Error in loadStationData(dataset = v86, var = "precip", lonLim = lon, : object 'nc' not found

ManhTrinh270 commented 4 years ago

Hi. I encountered the same issue. Have you fixed it yet? if yes, please show me how :) Many thanks!

tubabucak commented 4 years ago

I think at this point I gave up but I did not try it again. I am out of office now, I will try and let you know if it is working next week.

sixtohg commented 3 years ago

The problem was related with the condition used to decide if a dataset is defined by a NetCDF or other data format (text or zip): (grepl("\.ncml$|\.nc$|\.nc4$|", dataset)) It has a disjunction at the end which makes the condition always TRUE and, then, the function tries to open a NetCDF instead a zip or text file. The bug has been fixed in the development branch.