Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
migconforto committed Aug 27, 2022
1 parent 7287666 commit f4721fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export(pnadc_mean)
export(pnadc_porcent)
export(pnadc_total)
export(pnadc_tracks)
importFrom(PNADcIBGE,get_pnadc)
importFrom(PNADcIBGE,pnadc_design)
importFrom(PNADcIBGE,read_pnadc)
importFrom(ggplot2,facet_grid)
importFrom(ggplot2,geom_col)
importFrom(ggplot2,geom_point)
Expand Down
5 changes: 1 addition & 4 deletions R/baixa_pnadc.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#' @examples pnadc_download(2019, 1)
pnadc_download <- function(year, quartile, path = NULL) {
a <- webshot2::`%>%`(1,sum())
attachNamespace("PNADcIBGE")
if (is.null(path)) {
if (file.exists(fs::path_home(paste("Design_PNADc", year, quartile, sep = "_"))) == T) {
print("This edition of the PNADc has already been downloaded and can be used.")
Expand All @@ -25,15 +26,13 @@ pnadc_download <- function(year, quartile, path = NULL) {

file <- paste("Design_PNADc", year, quartile, sep = "_")
save(design_PNADc, file = fs::path_home(file))
utils::globalVariables('design_PNADc', package = 'PNADc.table')
}
}
else {
if (file.exists(paste(path, "/Design_PNADc_", year, "_", quartile, sep = "")) == T) {
print("This edition of the PNADc has already been downloaded and can be used.")

save(path, file = fs::path_home(paste("path_PNADcTABLE", year, quartile, sep = "_")))
utils::globalVariables('design_PNADc', package = 'PNADc.table')
}
else {
if (file.exists(paste(path, "/PNADC_0", quartile, year, ".txt", sep = "")) == T) {
Expand All @@ -45,15 +44,13 @@ pnadc_download <- function(year, quartile, path = NULL) {
path <- paste(path, "/Design_PNADc_", year, "_", quartile, sep = "")
save(design_PNADc, file = path)
save(path, file = fs::path_home(paste("path_PNADcTABLE", year, quartile, sep = "_")))
utils::globalVariables('design_PNADc', package = 'PNADc.table')
}
else {
design_PNADc <- PNADcIBGE::get_pnadc(year, quarter = quartile, design = T)

path <- paste(path, "/Design_PNADc_", year, "_", quartile, sep = "")
save(design_PNADc, file = path)
save(path, file = fs::path_home(paste("path_PNADcTABLE", year, quartile, sep = "_")))
utils::globalVariables('design_PNADc', package = 'PNADc.table')
}
}
}
Expand Down

0 comments on commit f4721fa

Please sign in to comment.