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

I'trying to load station data, but: Error in if (class(out$Data) == "numeric") datadimnames <- "time" : the condition has length > 1 #88

Open
cherryniu opened this issue Jul 1, 2022 · 2 comments

Comments

@cherryniu
Copy link

Hello, everyone. I copied the code on this website and and tried to load station data. I have two questions.
The first one is when I run str(di),it shows: .. ..$ startDate: POSIXlt[1:1], format: NA .. ..$ endDate : POSIXlt[1:1], format: NA, but the example on this website shows .. ..$ startDate: POSIXlt[1:1], format: "1961-01-01" .. ..$ endDate : POSIXlt[1:1], format: "2010-12-31".

str(di)
List of 3
$ Stations :List of 4
..$ station_id : chr [1:86] "000012" "000013" "000014" "000015" ...
..$ LonLatCoords : num [1:86, 1:2] 15.4 11.4 13 12.9 16.4 ...
.. ..- attr(, "dimnames")=List of 2
.. .. ..$ : chr [1:86] "000012" "000013" "000014" "000015" ...
.. .. ..$ : chr [1:2] "lon" "lat"
..$ times :List of 3
.. ..$ startDate: POSIXlt[1:1], format: NA
.. ..$ endDate : POSIXlt[1:1], format: NA
.. ..$ timeStep : 'difftime' num 24
.. .. ..- attr(
, "units")= chr "hours"
..$ other.metadata:List of 3
.. ..$ name : chr [1:86] "GRAZ" "INNSBRUCK" "SALZBURG" "SONNBLICK" ...
.. ..$ altitude: int [1:86] 366 577 437 3106 198 100 156 4 139 179 ...
.. ..$ source : chr [1:86] "ECA&D" "ECA&D" "ECA&D" "ECA&D" ...
$ Variables :'data.frame': 4 obs. of 3 variables:
..$ variable : chr [1:4] "precip" "tmean" "tmin" "tmax"
..$ unit : chr [1:4] "mm" "degC" "degC" "degC"
..$ missing.code: num [1:4] NaN NaN NaN NaN
$ Summary.stats: NULL

The second one is when I run the last line (example1 <- loadStationData(dataset = value, var="tmax", stationID = c("000234", "003946"), season = 6:8, years = 1981:2000)) the software reported an error: Error in if (class(out$Data) == "numeric") datadimnames <- "time" : the condition has length > 1.

library(loadeR)
value <- tempfile(fileext = ".zip")
download.file("www.value-cost.eu/sites/default/files/VALUE_ECA_86_v2.zip",
destfile = value)
di <- dataInventory(value)
str(di)
example1 <- loadStationData(dataset = value,
var="tmax",
stationID = c("000234", "003946"),
season = 6:8,
years = 1981:2000)

I would appreciate it if there is anyone who can help me solve this problem. Thank you for your time.

@idriswada007
Copy link

hello, please how did you solve this error?
thank you

@AniSanchez
Copy link

Hi! Would you be able to solve this problem? I got the same error.

Thanks!

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