rpradosiqueira / sidrar

A R interface to IBGE's SIDRA API
87 stars 11 forks source link

Erros em get_sidra() no tratamento de classific e category #6

Open mmaga opened 4 years ago

mmaga commented 4 years ago

Olá @rpradosiqueira ,

Há dois erros em get_sidra() no tratamento de classific e category que não permitem a realização da consulta a seguir:

    df <- get_sidra(x = 822,
                    variable = c(183,214,1982,215,216),
                    period = "2006",
                    geo = "City",
                    geo.filter = list("City" = c(3500303,3500402)),
                    classific = c("c220","c226"),
                    category = list("all",c(4857)),
                    header = TRUE,
                    format = 3))

São três correções, em 244, 260 e 430, e uma nova linha em 257:

Linha 244: if (is.null(category) || (is.character(category) & category == "all")) { Linha 257: path_classific <- "" Linha 260: path_classific <- paste0(path_classific, "/", paste0(classific[i], "/", paste0(category[[i]], collapse = ","))) Linha 430: path <- tidyr::unnest_legacy(path)

Agradeço antecipadamente,

Marcelo

fronzag commented 4 years ago

Olá @rpradosiqueira ,

Há dois erros em get_sidra() no tratamento de classific e category que não permitem a realização da consulta a seguir:

    df <- get_sidra(x = 822,
                    variable = c(183,214,1982,215,216),
                    period = "2006",
                    geo = "City",
                    geo.filter = list("City" = c(3500303,3500402)),
                    classific = c("c220","c226"),
                    category = list("all",c(4857)),
                    header = TRUE,
                    format = 3))

São três correções, em 244, 260 e 430, e uma nova linha em 257:

Linha 244: if (is.null(category) || (is.character(category) & category == "all")) { Linha 257: path_classific <- "" Linha 260: path_classific <- paste0(path_classific, "/", paste0(classific[i], "/", paste0(category[[i]], collapse = ","))) Linha 430: path <- tidyr::unnest_legacy(path)

Agradeço antecipadamente,

Marcelo

Fiz as alterações aqui e funcionou. Valeu!!!