Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Aug 28, 2023
1 parent c24ed17 commit 56fc987
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 42 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Authors@R:
Description: Download data from Brazil's population census. The package is built
on top of the 'Arrow' platform <https://arrow.apache.org/docs/r/>,
which allow users to work with larger-than-memory census data using
'dplyr' <https://arrow.apache.org/docs/r/articles/arrow.html#analyzing-arrow-data-with-dplyr>.
'dplyr' familiar functions. <https://arrow.apache.org/docs/r/articles/arrow.html#analyzing-arrow-data-with-dplyr>.
License: MIT + file LICENSE
URL: https://github.com/ipeaGIT/censobr, https://ipeagit.github.io/censobr/
BugReports: https://github.com/ipeaGIT/censobr/issues
Expand Down
17 changes: 3 additions & 14 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
# censobr v0.1.9999 dev

* Major changes:
* New data sets for the 2000 census (population, households and families) Closes #1.
* New data sets for the 2010 census (emmigration). Closes #1.
* All data sets are now enriched with geography columns following {geobr} name standards. This should help data manipulation and integration with spatial data from the [{geobr}](https://github.com/ipeaGIT/geobr) package. The added columns are: c('code_muni', 'code_state', 'abbrev_state', 'name_state', 'code_region', 'name_region', 'code_weighting'). Closes #5.
# censobr v0.1.0

* Launch of **censobr** v0.1.0 on CRAN https://cran.r-project.org/package=censobr
* All data sets are now enriched with geography columns following {geobr} name standards. This should help data manipulation and integration with spatial data from the [{geobr}](https://github.com/ipeaGIT/geobr) package. The added columns are: c('code_muni', 'code_state', 'abbrev_state', 'name_state', 'code_region', 'name_region', 'code_weighting'). Closes #5.
* Data included in this version:
* 2000 Census
* Microdata of population, households and families.
* 2010 Census
* Microdata of population, households, deaths and emmigration.


# censobr v0.1.0

* Launch of **censobr** v0.1.0 on CRAN https://cran.r-project.org/package=censobr
* Data included in this version:
* 2010 Census
* Microdata of population, households and deaths.
2 changes: 1 addition & 1 deletion R/read_deaths.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ read_deaths <- function(year = 2010,
checkmate::assert_logical(cache)

# data available for the years:
years <- c(2000, 2010)
years <- c(2010)
if (isFALSE(year %in% years)) { stop(paste0("Error: Data currently only available for the years ",
paste(years), collapse = " "))}

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ devtools::install_github("ipeaGIT/censobr")

## Basic usage

The package currently includes 3 main functions to download Census microdata:
The package currently includes 5 main functions to download Census microdata:

1. `read_population()`
2. `read_households()`
3. `read_deaths()`
4. `read_families()`
5. `read_emmigration()`


The syntax of all **censobr** functions operate on the same logic so it becomes intuitive to download any data set using a single line of code. Like this:

Expand Down
10 changes: 4 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
## R CMD check results

── R CMD check results ───────────────────────────────────────────────────────────────────── censobr 0.1.0 ────
Duration: 28.8s
── R CMD check results ──────────────────────────────────────────────────────── censobr 0.1.0 ────
Duration: 2m 4.1s

0 errors ✔ | 0 warnings ✔ | 0 notes ✔

* This is a new release.


* Reviewed description text
* Removed example from internal function
* Removed commented examples

Removed "\dontrun"" from examples
* Removed "\dontrun"" from examples
* Updated dependency on R version 4.0 or later
10 changes: 7 additions & 3 deletions man/read_deaths.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/read_emmigration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/read_families.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/read_households.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/read_population.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/roxygen/templates/cache.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#' @param cache Logical. Whether the function should read the data cached
#' locally in future calls, which is much faster. Defaults to `TRUE`.
#' If `FALSE`, the function will download the file from the internet.
#' @param cache Logical. The first time the user runs the function, `censobr`
#' will download the file from the internet and store it locally at
#' `tools::R_user_dir('censobr', 'cache')`, so that the file only needs
#' to be download once. When the `cache` parameter is set to `TRUE`
#' (Default), the function will read the data cached locally, which is
#' much faster. If `FALSE`, the function will download the file from the
#' internet again.
4 changes: 3 additions & 1 deletion tests/tests_rafa/test_rafa.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# devtools::install_github("ipeaGIT/r5r", subdir = "r-package", force=T)
library(censobr)
library(dplyr)
library(arrow)

### add labels

df <- read_deaths()
df <- read_emmigration(year = 2010)
head(df) |> collect()

ds2 <- df |> mutate(V0001 = case_when(
V0001 == 11 ~'Rondônia'))
Expand Down

0 comments on commit 56fc987

Please sign in to comment.