lhmet / inmetr

DEPRECATED A R-package to Import Historical Data from Brazilian Meteorological Stations
Other
20 stars 11 forks source link

Error in (rowheader + 1):(length(x) - 1) : argument of length 0 #10

Open Schuch666 opened 4 years ago

Schuch666 commented 4 years ago

Hi,

I'm trying to run the README.md example but I got this error wen trying to import data:

------------------------------
station: 83936
OK (HTTP 200).
Error in (rowheader + 1):(length(x) - 1) : argument of length 0

My code is:

stations <- c("Santa Maria", "Macapá")
stations_rows <- pmatch(stations, bdmep_meta$name)
stns_codes <- bdmep_meta[stations_rows, "id"] 
# the line that returns this error
met_data <- bdmep_import(id      = stns_codes,
                         sdate   = "01/01/2012", 
                         edate   = "01/02/2012",
                         destdir = 'C:/',
                         email   = "user@gmail.com",
                         passwd  = "666",
                         verbose = T)

Is this problem related to the code (in the example)? or with any change in the location or format of the data (I saw that the site has changed its address)?

Thank you, Daniel

lhmet commented 4 years ago

Hello @Schuch666, Inmet has changed the way to acces the bdmep. You can see it clicking the link below. They redirect you to a new URL. This means that {inmet} will be retired (archived) very soon in GitHub. I hope you enjoyed it while it lasted. The new bdmep does everything by email. This makes it difficult to automate data retrieval. Thanks for letting me know about the problem.

https://portal.inmet.gov.br/paginas/redirect?&mRelEstacao=83743&btnProcesso=serie&mRelDtInicio=01/01/1961&mRelDtFim=25/08/2020&mAtributos=1,1,1,1,1,1,1,1,1,1,1,1,1,,1,1,