ropensci / GSODR

API Client for Global Surface Summary of the Day (GSOD) Weather Data Client in R
https://docs.ropensci.org/GSODR
Other
90 stars 15 forks source link

get_GSOD not downloading data from selected year #34

Closed emdelponte closed 6 years ago

emdelponte commented 6 years ago

Lond_2005 <- get_GSOD(years = 2005, station = "837660-99999")

It is returning only 2010 irrespectively of the chosen year.

$ YEAR <chr> "2010", "2010", "2010", "2010", "2010", "2010",...

emdelponte commented 6 years ago

I discovered something. For some reason the new data frame is not downloading the requested year. In the example below, it keeps loading the 2005 year for the newly created get2 data frame.

get1 <- get_GSOD(years = 2005, station = "955510-99999")

get2 <- get_GSOD(years = 2006, station = "955510-99999")

adamhsparks commented 6 years ago

Well that's interesting. I'll look into it. Thanks Emerson.

emdelponte commented 6 years ago

I did more tests and notice that the new data frame preserves the data from the previous one. So, if there are 365 observations in get1, get2(from the example above) will have double! It is working as rbind function.

Also noticed that BR stations did not have PRCP data for the years I want. Also, some stations have limited coverage :(

adamhsparks commented 6 years ago

I've fixed issue #2.

Boarding my plane now. Will push to GH later

adamhsparks commented 6 years ago

In devel branch now

adamhsparks commented 6 years ago

Well, I thought it was fixed, apparently not

adamhsparks commented 6 years ago

Hi @emdelponte, I think I've fixed the second issue, which I'm guessing is related to the 1st, I think you might have run a query for 2010 before 2005?

I think this first issue is related to #33, I still need to fix that.

The fix for #34 is in the Main branch now.

adamhsparks commented 6 years ago

As for your question about multiple years, yes, a vector like 2005:2010 will work to download multiple years.