Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tubabucak opened this issue Jul 22, 2020 · 3 comments
Open

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

tubabucak opened this issue Jul 22, 2020 · 3 comments

Comments

@tubabucak
Copy link

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
Copy link

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

@tubabucak
Copy link
Author

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
Copy link
Contributor

sixtohg commented Sep 21, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants