diegovalle / rsinaica

R package for downloading air quality data from the Mexican National Air Quality Information System (SINAICA)
https://hoyodesmog.diegovalle.net/rsinaica/
Other
6 stars 2 forks source link

senaica_param_data: Lexical Error #5

Closed juancarlosyanes1 closed 2 months ago

juancarlosyanes1 commented 2 months ago

Hi,

Thanks for the great tool.

When using senaica_param_data I get the following error:

> df <- sinaica_param_data("O3", "2015-10-14", "2015-10-14")
Error: lexical error: invalid char in json text.
                                       <br /> <b>Warning</b>:  file_ge
                     (right here) ------^

Wondering how I can solve this, thank you in advance.

diegovalle commented 2 months ago

Hi, sometimes the SINAICA website returns an error, as a workaround you could try:

1) Using the API, for example https://api.datos.gob.mx/v2/sinaica?pageSize=5000&parametro=O3&page=1, but I'm not sure it's being update anymore 2) Try looping through the stations you need data from by using the sinaica_station_data function

sinaica_station_data(271, "O3", "2015-09-11", "2015-09-11", "Crude")