ipeagit / censobr Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://ipeagit.github.io/censobr/
License: Other
Home Page: https://ipeagit.github.io/censobr/
License: Other
The package currently passes in every check when tested locally. It also passes the tests in Github Actions in every OS, except for macOS-latest (oldrel). Here's the output of GHA, rather difficult to interpret, tbh.
The error occurs when building the vignette. I've tried removing the vignette entirely, and all checks passed. See this.
Run options(crayon.enabled = TRUE)
── R CMD build ─────────────────────────────────────────────────────────────────
pdflatex not found! Not building PDF manual.
* checking for file ‘.../DESCRIPTION’ ... OK
* preparing ‘censobr’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ...sh: line 1: 5061 Illegal instruction: 4 '/Library/Frameworks/R.framework/Resources/bin/Rscript' --vanilla --default-packages= -e "tools::buildVignettes(dir = '.', tangle = TRUE)" > '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpnQbntJ/xshell[13](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:14)95ed07180' 2>&1
ERROR
--- re-building ‘censobr.Rmd’ using rmarkdown
*** caught illegal operation ***
address 0x1120d8a63, cause 'illegal opcode'
Traceback:
1: Table__from_ExecPlanReader(self)
2: x$read_table()
3: as_arrow_table.RecordBatchReader(reader)
4: as_arrow_table(reader)
5: as_arrow_table.arrow_dplyr_query(x)
6: as_arrow_table(x)
7: doTryCatch(return(expr), name, parentenv, handler)
8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
9: tryCatchList(expr, classes, parentenv, handlers)
10: tryCatch(as_arrow_table(x), error = function(e, call = caller_env(n = 4)) { augment_io_error_msg(e, call, schema = schema())})
11: compute.arrow_dplyr_query(x)
12: collect.arrow_dplyr_query(filter(pop, abbrev_state == "RJ"))
13: collect(filter(pop, abbrev_state == "RJ"))
[14](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:15): group_by(collect(filter(pop, abbrev_state == "RJ")), V0606)
[15](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:16): summarize(group_by(collect(filter(pop, abbrev_state == "RJ")), V0606), higher_edu = sum(V0010[which(V6400 == 4)])/sum(V0010), pop = sum(V0010))
[16](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:17): collect(summarize(group_by(collect(filter(pop, abbrev_state == "RJ")), V0606), higher_edu = sum(V0010[which(V6400 == 4)])/sum(V0010), pop = sum(V0010)))
[17](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:18): eval(expr, envir, enclos)
[18](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:19): eval(expr, envir, enclos)
[19](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:20): eval_with_user_handlers(expr, envir, enclos, user_handlers)
[20](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:21): withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers))
[21](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:22): withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)
[22](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:23): handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler))
[23](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:24): timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)))
[24](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:25): evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, debug = debug, last = i == length(out), use_try = stop_on_error != 2L, keep_warning = keep_warning, keep_message = keep_message, log_echo = log_echo, log_warning = log_warning, output_handler = output_handler, include_timing = include_timing)
[25](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:26): evaluate::evaluate(...)
[26](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:27): evaluate(code, envir = env, new_device = FALSE, keep_warning = if (is.numeric(options$warning)) TRUE else options$warning, keep_message = if (is.numeric(options$message)) TRUE else options$message, stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options))
[27](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:28): in_dir(input_dir(), expr)
[28](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:29): in_input_dir(evaluate(code, envir = env, new_device = FALSE, keep_warning = if (is.numeric(options$warning)) TRUE else options$warning, keep_message = if (is.numeric(options$message)) TRUE else options$message, stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options)))
[29](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:30): eng_r(options)
[30](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:31): block_exec(params)
[31](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:32): call_block(x)
[32](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:33): process_group.block(group)
[33](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:34): process_group(group)
[34](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:35): withCallingHandlers(if (tangle) process_tangle(group) else process_group(group), error = function(e) if (xfun::pkg_available("rlang", "1.0.0") && !xfun::check_old_package("learnr", "0.11.3")) rlang::entrace(e))
[35](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:36): withCallingHandlers(withCallingHandlers(if (tangle) process_tangle(group) else process_group(group), error = function(e) if (xfun::pkg_available("rlang", "1.0.0") && !xfun::check_old_package("learnr", "0.11.3")) rlang::entrace(e)), error = function(e) { setwd(wd) write_utf8(res, output %n% stdout()) message("\nQuitting from lines ", paste(current_lines(i), collapse = "-"), if (labels[i] != "") sprintf(" [%s]", labels[i]), sprintf(" (%s)", knit_concord$get("infile"))) })
[36](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:37): process_file(text, output)
[37](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:38): knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
[38](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:39): rmarkdown::render(file, encoding = encoding, quiet = quiet, envir = globalenv(), output_dir = getwd(), ...)
[39](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:40): vweave_rmarkdown(...)
[40](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:41): engine$weave(file, quiet = quiet, encoding = enc)
[41](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:42): doTryCatch(return(expr), name, parentenv, handler)
[42](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:43): tryCatchOne(expr, names, parentenv, handlers[[1L]])
[43](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:44): tryCatchList(expr, classes, parentenv, handlers)
[44](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:45): tryCatch({ engine$weave(file, quiet = quiet, encoding = enc) setwd(startdir) output <- find_vignette_product(name, by = "weave", engine = engine) if (!have.makefile && vignette_is_tex(output)) { texi2pdf(file = output, clean = FALSE, quiet = quiet) output <- find_vignette_product(name, by = "texi2pdf", engine = engine) } outputs <- c(outputs, output)}, error = function(e) { thisOK <<- FALSE fails <<- c(fails, file) message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s", file, conditionMessage(e)))})
[45](https://github.com/ipeaGIT/censobr/actions/runs/6055327169/job/16434102385#step:11:46): tools::buildVignettes(dir = ".", tangle = TRUE)
An irrecoverable exception occurred. R is aborting now ...
Error: Error in proc$get_built_file() : Build process failed
Calls: <Anonymous> ... build_package -> with_envvar -> force -> <Anonymous>
Execution halted
Error: Process completed with exit code 1.
running the function interview_manual()
will open the pdf of an interview manual on the web browser.
Add tests to the interview_manual()
function, and create vignette
IBGE updated the census tract files for the state of Goias on Oct/2023. See this.
add a merge_households
(logical) parameter to indicate whether the function should merge household variables to the output data.
The plan is to include this parameter after geobr migrates to using geoparquet files. See this
The following columns with basic geography info will be added to data sets. This should help data manipulation and integration with spatial data from the {geobr} package.
code_muni
code_state
abbrev_state
name_state
code_region
name_region
code_weighting
as of 06/Sept/2023
censobr Coverage: 28.31%
R/add_labels_emigration.R: 4.91%
R/add_labels_households.R: 14.89%
R/add_labels_population.R: 23.85%
R/add_labels_families.R: 38.24%
R/add_labels_mortality.R: 44.74%
R/read_families.R: 90.48% R/read_households.R: 90.48%
R/read_population.R: 90.48%
R/censobr_cache.R: 94.44% R/read_emigration.R: 95.24%
R/read_mortality.R: 95.24%
Initially, here's the idea. One function per data set
add_labels_households(arrw, lang = c('PT', 'EN'))
add_labels_population(arrw, lang = c('PT', 'EN'))
add_labels_mortality(arrw, lang = c('PT', 'EN'))
Depending on how it goes, it might be better to have a single function that applies to different data sets. E.g.
add_labels(arrw, dataset = c('households', 'population', 'mortality'), lang = c('PT', 'EN'))
The downside of this first approach is having too many functions, code repetition because of some variables that are in common between datasets. Meanwhile, the downside of the second approach is that the function will be too big, and harder to manage.
Tem alguma previsão para o censo 2022 seja incluído no pacote?
Hi @rafapereirabr !
I have used the population and household tables from 2010 to 1980. In 1991 I found a problem in the identification code column of the municipality of the observation. I don't know if I'm doing something wrong, but of the 17,045,653 observations, 8,575,800 are missing from this column. I was surprised when I couldn't filter the information for the municipality of Rio de Janeiro. Here's the code I used to test it:
> census1991_2 <- read_population(year = 1991, cache = T)
Reading data cached locally.
> census1991_2 |>
+ select(code_muni) |>
+ mutate(test = is.na(code_muni)) |>
+ count(test) |>
+ collect()
# A tibble: 2 × 2
test n
<lgl> <int>
1 FALSE 8469853
2 TRUE 8575800
running the function questionnaire()
will open the pdf of a questionnaire on the web browser.
Add tests to the questionnaire()
function, and create vignette
Agregados por Setores Censitários
read_tracts()
censobr_cache(delete_file = 'all')
should also remove data from old data releases
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.