Skip to content

Commit

Permalink
agrego assert para que las variables que se pide esten en la base
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoKoz committed Jun 30, 2020
1 parent 5a9bb04 commit e0824d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/get_microdata_internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ mas informacon en: https://www.indec.gob.ar/ftp/cuadros/sociedad/anexo_informe_e
vars <- colnames(base)
}
if (nrow(base)>0) {

chequeo <- vars %in% colnames(base)


assertthat::assert_that(all(chequeo), msg=glue::glue('Las variables: {glue::glue_collapse(vars[!chequeo],sep = ", ", last = ", y ")} no se encuentran disponibles para esta base.
Puede deberse a que son variables de la base individual (hogar) y se quiere descargar la base hogar (individual)'))
base %>%
dplyr::rename_all(toupper) %>%
dplyr::select(vars)
Expand Down

0 comments on commit e0824d0

Please sign in to comment.