diegovalle / aire.zmvm
Showing 2 of 2 files from the diff.

@@ -20,7 +20,7 @@
Loading
20 20
#' }
21 21
download_pollution <- function(year, progress = interactive()) {
22 22
  get_data <- function(year) {
23 -
    RAMA <- paste0("http://148.243.232.112:8080/",
23 +
    RAMA <- paste0("http://datosabiertos.aire.cdmx.gob.mx:8080/",
24 24
                   "opendata/anuales_horarios_gz/contaminantes_")
25 25
    ## The files from 2012 onwards changed the name of the columns
26 26
    ## cve_station and cve_parameter to id_station and id_parameter
@@ -90,7 +90,7 @@
Loading
90 90
#' }
91 91
download_meteorological <- function(year, progress = interactive()) {
92 92
  get_data <- function(year) {
93 -
    REDMET <- paste0("http://148.243.232.112:8080/",
93 +
    REDMET <- paste0("http://datosabiertos.aire.cdmx.gob.mx:8080/",
94 94
                     "opendata/anuales_horarios_gz/meteorolog%C3%ADa_")
95 95
    ## The files from 2012 onwards changed the name of the columns
96 96
    ## cve_station and cve_parameter to id_station and id_parameter
@@ -166,10 +166,10 @@
Loading
166 166
  if (!(identical("PbPST", type) || identical("PST, PM10, PM25", type)))
167 167
    stop("type should be 'PbPST', or 'PST, PM10, PM25'")
168 168
  if (type == "PbPST")
169 -
    REDMA <- paste0("http://148.243.232.112:8080/opendata/red_manual/",
169 +
    REDMA <- paste0("http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/red_manual/",
170 170
                    "red_manual_plomo.csv")
171 171
  else if (type == "PST, PM10, PM25")
172 -
    REDMA <- paste0("http://148.243.232.112:8080/opendata/red_manual/",
172 +
    REDMA <- paste0("http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/red_manual/",
173 173
                    "red_manual_particulas_susp.csv")
174 174
  df <- read_csv(str_c(REDMA),
175 175
                 skip = 8, progress = FALSE, col_types = list(
@@ -217,16 +217,16 @@
Loading
217 217
    stop("type should be 'DEPOSITO', or 'CONCENTRACION'")
218 218
  # Deposito humedo - deposito
219 219
  if (deposition == "HUMEDO" & type == "DEPOSITO")
220 -
    REDDA <- "http://148.243.232.112:8080/opendata/redda/deposito.csv"
220 +
    REDDA <- "http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/redda/deposito.csv"
221 221
  # Deposito humedo - concentracion
222 222
  if (deposition == "HUMEDO" & type == "CONCENTRACION")
223 -
    REDDA <- "http://148.243.232.112:8080/opendata/redda/concentracion.csv"
223 +
    REDDA <- "http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/redda/concentracion.csv"
224 224
  # Deposito total - deposito
225 225
  if (deposition == "TOTAL" & type == "DEPOSITO")
226 -
    REDDA <- "http://148.243.232.112:8080/opendata/redda/depositoT.csv"
226 +
    REDDA <- "http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/redda/depositoT.csv"
227 227
  # Deposito total - concentracion
228 228
  if (deposition == "TOTAL" & type == "CONCENTRACION")
229 -
    REDDA <- "http://148.243.232.112:8080/opendata/redda/concentracionT.csv"
229 +
    REDDA <- "http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/redda/concentracionT.csv"
230 230
  df <- read_csv(REDDA,
231 231
                 skip = 8, progress = FALSE, col_types = list(
232 232
                   Date = col_character(),
@@ -268,9 +268,9 @@
Loading
268 268
download_radiation <- function(type, year, progress = interactive()) {
269 269
  get_data <- function(year, type) {
270 270
    if (type == "UVA")
271 -
      RADIACION <- "http://148.243.232.112:8080/opendata/radiacion/UVA_"
271 +
      RADIACION <- "http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/radiacion/UVA_"
272 272
    else if (type == "UVB")
273 -
      RADIACION <- "http://148.243.232.112:8080/opendata/radiacion/UVB_"
273 +
      RADIACION <- "http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/radiacion/UVB_"
274 274
    df <- read_csv(str_c(RADIACION, year, ".csv"),
275 275
                   skip = 8, progress = FALSE, col_types = list(
276 276
                     Date = col_character(),
@@ -333,10 +333,10 @@
Loading
333 333
download_24hr_average <- function(type, year, progress = interactive()) {
334 334
  get_data <- function(year, type) {
335 335
    if (type == "PS")
336 -
      base_url <- paste0("http://148.243.232.112:8080/opendata/",
336 +
      base_url <- paste0("http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/",
337 337
                         "promedios_diarios/promedios_")
338 338
    else if (type == "SO2")
339 -
      base_url <- paste0("http://148.243.232.112:8080/opendata/",
339 +
      base_url <- paste0("http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/",
340 340
                         "promedios_diarios/promedios_")
341 341
342 342
    df <- read_csv(str_c(base_url, year, "_", tolower(type), ".csv"),
@@ -397,7 +397,7 @@
Loading
397 397
#' }
398 398
download_pressure <- function(year, progress = interactive()) {
399 399
  get_data <- function(year) {
400 -
    PRESION <- "http://148.243.232.112:8080/opendata/presion/PA_"
400 +
    PRESION <- "http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/presion/PA_"
401 401
    df <- read_csv(str_c(PRESION, year, ".csv"),
402 402
                   skip = 8, progress = FALSE,
403 403
                   col_types = list(

@@ -131,7 +131,7 @@
Loading
131 131
#' @importFrom utils download.file unzip
132 132
#' @keywords internal
133 133
.get_archive_wsp <- function(syear) {
134 -
  download_loc <- paste0("http://148.243.232.112:8080/opendata/excel/",
134 +
  download_loc <- paste0("http://datosabiertos.aire.cdmx.gob.mx:8080/opendata/excel/",
135 135
                         "REDMET/", syear, "REDMET.zip")
136 136
137 137
  # unzip
Files Coverage
R 84.47%
Project Totals (10 files) 84.47%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading