Skip to content

Commit

Permalink
Dev generals pkg review (#125)
Browse files Browse the repository at this point in the history
* All comments for general changes have been implemented.

* Automatic readme update

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
macataci and actions-user committed Jun 12, 2024
1 parent 2c01cb2 commit ff9c60f
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 72 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
^codecov\.yml$
^_pkgdown\.yml$
^docs$
^pkgdown$
^\.lintr$
^.*\.Rproj$
^\.Rproj\.user$
Expand Down
30 changes: 24 additions & 6 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
linters: linters_with_tags(
tags = NULL, # include all linters
linters: all_linters(
packages = c("lintr", "etdev"),
object_name_linter = NULL,
undesirable_function_linter = NULL,
implicit_integer_linter = NULL,
extraction_operator_linter = NULL,
todo_comment_linter = NULL,
library_call_linter = NULL,
undesirable_function_linter(
modify_defaults(
default_undesirable_functions,
citEntry = "use the more modern bibentry() function",
library = NULL # too many false positive in too many files
)
),
function_argument_linter = NULL,
indentation_linter = NULL, # unstable as of lintr 3.1.0
# Use minimum R declared in DESCRIPTION or fall back to current R version.
# Install etdev package from https://github.com/epiverse-trace/etdev
backport_linter(if (length(x <- etdev::extract_min_r_version())) x else getRversion())
)
exclusions: list(
"tests/testthat.R" = list(unused_import_linter = Inf),
"tests/testthat.R" = list(
unused_import_linter = Inf
),
"tests" = list(
undesirable_function_linter = Inf
),
"data-raw" = list(
missing_package_linter = Inf,
namespace_linter = Inf
)
)
),
# RcppExports.R is auto-generated and will not pass many linters. In
# particular, it can create very long lines.
"R/RcppExports.R",
# R/stanmodels.R is auto-generated and will not pass many linters. In
# particular, it uses `sapply()`.
"R/stanmodels.R"
)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2023
YEAR: 2024
COPYRIGHT HOLDER: ColOpenData authors
14 changes: 10 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 0.1.0
# 0.2.0

* This project now includes a
[`NEWS.md`](https://r-pkgs.org/other-markdown.html#sec-news) file to inform
users about changes and new features.
This project now includes a [`NEWS.md`](https://r-pkgs.org/other-markdown.html#sec-news) file to inform users about changes and new features.

## New Features

- **Data Categories:** ColOpenData now includes four data categories: demographic, geospatial, climate, and population projections.

- **Data Merging:** Users can now merge information from demographic and geospatial data.

- **Auxiliary Functions:** Added auxiliary functions to retrieve information using DIVIPOLA codification.
8 changes: 5 additions & 3 deletions R/dev-utils.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# This unexported function adds a custom item to `usethis::use_release_issue()`
release_bullets <- function() { # nocov start
release_bullets <- function() {
c(
"Run `goodpractice::gp()`",
"Review [WORDLIST](https://docs.cran.dev/spelling#wordlist)"
"Review [WORDLIST](https://docs.cran.dev/spelling#wordlist)",
"Check if `# nolint` comments are still needed with recent lintr releases",
"All contributors to this release are acknowledged in some way"
)
} # nocov end
}
68 changes: 23 additions & 45 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file. -->

<!-- The code to render this README is stored in .github/workflows/render-readme.yaml -->

<!-- Variables marked with double curly braces will be transformed beforehand: -->

<!-- `packagename` is extracted from the DESCRIPTION file -->
<!-- `gh_repo` is extracted via a special environment variable in GitHub Actions -->

<!-- `gh_repo` is extracted via a special environment variable in GitHub Actions -->

```{r, include = FALSE}
knitr::opts_chunk$set(
Expand All @@ -18,87 +21,62 @@ knitr::opts_chunk$set(
)
```

# ColOpenData <img src="man/figures/logo.svg" align="right" width="200" />
# {{ packagename }} <img src="man/figures/logo.svg" align="right" width="200"/>

<!-- badges: start -->

[![License:
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit/)
[![R-CMD-check](https://github.com/epiverse-trace/ColOpenData/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/epiverse-trace/ColOpenData/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/epiverse-trace/ColOpenData/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epiverse-trace/ColOpenData?branch=main)
[![lifecycle-experimental](https://raw.githubusercontent.com/reconverse/reconverse.github.io/master/images/badge-experimental.svg)](https://www.reconverse.org/lifecycle.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/ColOpenData)](https://CRAN.R-project.org/package=ColOpenData)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit/) [![R-CMD-check](https://github.com/epiverse-trace/ColOpenData/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/epiverse-trace/ColOpenData/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/epiverse-trace/ColOpenData/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epiverse-trace/ColOpenData?branch=main) [![lifecycle-experimental](https://raw.githubusercontent.com/reconverse/reconverse.github.io/master/images/badge-experimental.svg)](https://www.reconverse.org/lifecycle.html#experimental) [![CRAN status](https://www.r-pkg.org/badges/version/ColOpenData)](https://CRAN.R-project.org/package=ColOpenData)

<!-- badges: end -->

**ColOpenData** is a package designed to access curated and wrangled Colombian demographic, geospatial and climate data, retrieved from various open Colombian data sources. The package addresses the challenge of scattered Colombian data across multiple web sources by providing functions that enable users to select and load desired datasets without the need for extensive data acquisition processes. Additionally, the tidy data structure offered for demographic and climate data facilitates analysis and visualization.

ColOpenData is developed at [Universidad de Los
Andes](https://uniandes.edu.co/) as part of the [Epiverse-TRACE
program](https://data.org/initiatives/epiverse/).
ColOpenData is developed at [Universidad de Los Andes](https://uniandes.edu.co/) as part of the [Epiverse-TRACE program](https://data.org/initiatives/epiverse/).

## Installation

You can install the development version of ColOpenData from
[GitHub](https://github.com/) with:
You can install the development version of ColOpenData from [GitHub](https://github.com/) with:

``` r
# install.packages("pak")
pak::pak("epiverse-trace/ColOpenData")
```

## Quick Overview

**ColOpenData** contains data from two public data sources: The National
Administrative Department of Statistics
[(DANE)](https://www.dane.gov.co/index.php/en/), and the Institute of Hydrology,
Meteorology and Environmental Studies [(IDEAM)]( http://www.ideam.gov.co/).
The available data is divided in four categories:
**ColOpenData** contains data from two public data sources: The National Administrative Department of Statistics [(DANE)](https://www.dane.gov.co/index.php/en/), and the Institute of Hydrology, Meteorology and Environmental Studies [(IDEAM)](http://www.ideam.gov.co/). The available data is divided in four categories:

- **Demographic:** Demographic and Socioeconomic data presents information from
the National Population and Dwelling Census (CNPV) of 2018. The CNPV data corresponds to the most recent census available to
date and the information is presented as an answer to three questions:
How many are we?, Where are we? and How do we live? Further information can be consulted
[here](https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/censo-nacional-de-poblacion-y-vivenda-2018).
- **Demographic:** Demographic and Socioeconomic data presents information from the National Population and Dwelling Census (CNPV) of 2018. The CNPV data corresponds to the most recent census available to date and the information is presented as an answer to three questions: How many are we?, Where are we? and How do we live? Further information can be consulted at the [CNPV results](https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/censo-nacional-de-poblacion-y-vivenda-2018).

- **Geospatial:** This data is retrieved from the National Geostatistical Framework (MGN), which includes maps and a summarized version of the 2018 census, aggregated to spatial geometries. The data is available at different aggregation levels including: Blocks, Urban and Rural Sections, Urban and Rural Sectors, Urban Areas, Municipalities and Departments. More information is available [here](https://www.dane.gov.co/index.php/actualidad-dane/5454-el-dane-actualizo-el-marco-geoestadistico-nacional-a-2018).
- **Geospatial:** This data is retrieved from the National Geostatistical Framework (MGN), which includes maps and a summarized version of the 2018 census, aggregated to spatial geometries. The data is available at different aggregation levels including: Blocks, Urban and Rural Sections, Urban and Rural Sectors, Urban Areas, Municipalities and Departments. More information is available at [MGN update news](https://www.dane.gov.co/index.php/actualidad-dane/5454-el-dane-actualizo-el-marco-geoestadistico-nacional-a-2018).

- **Climate:** Climate data is recovered from backup information provided by IDEAM, containing historical data from the first station in the country until May 31st 2023. This backup includes temperature, precipitation, sunshine duration, wind direction, among others. More information can be found [here](http://www.ideam.gov.co/).
- **Climate:** Climate data is recovered from backup information provided by IDEAM, containing historical data from the first station in the country until May 31st 2023. This backup includes temperature, precipitation, sunshine duration, wind direction, among others. More information can be found at [IDEAM website](http://www.ideam.gov.co/).

- **Population projections:** Population Projections data
contains the population projections and back projections from 1950 to 2070, considering the post COVID-19 update, which was calculated
based on the results of CNPV of 2018. Further information can be consulted
[here](https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/proyecciones-de-poblacion).
- **Population projections:** Population Projections data contains the population projections and back projections from 1950 to 2070, considering the post COVID-19 update, which was calculated based on the results of CNPV of 2018. Further information can be consulted at [DANE website](https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/proyecciones-de-poblacion).

Documentation and vignettes are available for the modules in the [user vignettes](https://epiverse-trace.github.io/ColOpenData/).

### Related R Packages

Similar R packages are offered for international communities, allowing the user to download census, geospatial and climate data.

- [cancensus](https://mountainmath.github.io/cancensus/): Canada
- [censobr](https://ipeagit.github.io/censobr/): Brazil
- [tidycensus](https://walker-data.com/tidycensus/): US
- [geofi](https://ropengov.github.io/geofi/): Finland
- [climate](https://bczernecki.github.io/climate/)
- [cancensus](https://mountainmath.github.io/cancensus/): Canada
- [censobr](https://ipeagit.github.io/censobr/): Brazil
- [tidycensus](https://walker-data.com/tidycensus/): US
- [geofi](https://ropengov.github.io/geofi/): Finland
- [climate](https://bczernecki.github.io/climate/)

### Lifecycle

This package is currently *experimental*, as defined by the [RECON software
lifecycle](https://www.reconverse.org/lifecycle.html). Therefore, this is
a functional draft and can be tested outside of the development team. However,
it still may change over time.
This package is currently *experimental*, as defined by the [RECON software lifecycle](https://www.reconverse.org/lifecycle.html). Therefore, this is a functional draft and can be tested outside of the development team. However, it still may change over time.

### Contributions

Contributions are welcome via [pull
requests](https://github.com/ColOpenData/pulls).
Contributions are welcome via [pull requests](https://github.com/ColOpenData/pulls).

### Code of Conduct

Please note that the ColOpenData project is released with a [Contributor
Code of
Conduct](https://github.com/epiverse-trace/.github/blob/main/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.
Please note that the ColOpenData project is released with a [Contributor Code of Conduct](https://github.com/epiverse-trace/.github/blob/main/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.

### Funding

Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- `packagename` is extracted from the DESCRIPTION file -->
<!-- `gh_repo` is extracted via a special environment variable in GitHub Actions -->

# ColOpenData <img src="man/figures/logo.svg" align="right" width="200" />
# ColOpenData <img src="man/figures/logo.svg" align="right" width="200"/>

<!-- badges: start -->

Expand All @@ -17,6 +17,7 @@ coverage](https://codecov.io/gh/epiverse-trace/ColOpenData/branch/main/graph/bad
[![lifecycle-experimental](https://raw.githubusercontent.com/reconverse/reconverse.github.io/master/images/badge-experimental.svg)](https://www.reconverse.org/lifecycle.html#experimental)
[![CRAN
status](https://www.r-pkg.org/badges/version/ColOpenData)](https://CRAN.R-project.org/package=ColOpenData)

<!-- badges: end -->

**ColOpenData** is a package designed to access curated and wrangled
Expand Down Expand Up @@ -56,28 +57,30 @@ four categories:
of 2018. The CNPV data corresponds to the most recent census available
to date and the information is presented as an answer to three
questions: How many are we?, Where are we? and How do we live? Further
information can be consulted
[here](https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/censo-nacional-de-poblacion-y-vivenda-2018).
information can be consulted at the [CNPV
results](https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/censo-nacional-de-poblacion-y-vivenda-2018).

- **Geospatial:** This data is retrieved from the National
Geostatistical Framework (MGN), which includes maps and a summarized
version of the 2018 census, aggregated to spatial geometries. The data
is available at different aggregation levels including: Blocks, Urban
and Rural Sections, Urban and Rural Sectors, Urban Areas,
Municipalities and Departments. More information is available
[here](https://www.dane.gov.co/index.php/actualidad-dane/5454-el-dane-actualizo-el-marco-geoestadistico-nacional-a-2018).
Municipalities and Departments. More information is available at [MGN
update
news](https://www.dane.gov.co/index.php/actualidad-dane/5454-el-dane-actualizo-el-marco-geoestadistico-nacional-a-2018).

- **Climate:** Climate data is recovered from backup information
provided by IDEAM, containing historical data from the first station
in the country until May 31st 2023. This backup includes temperature,
precipitation, sunshine duration, wind direction, among others. More
information can be found [here](http://www.ideam.gov.co/).
information can be found at [IDEAM website](http://www.ideam.gov.co/).

- **Population projections:** Population Projections data contains the
population projections and back projections from 1950 to 2070,
considering the post COVID-19 update, which was calculated based on
the results of CNPV of 2018. Further information can be consulted
[here](https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/proyecciones-de-poblacion).
the results of CNPV of 2018. Further information can be consulted at
[DANE
website](https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/proyecciones-de-poblacion).

Documentation and vignettes are available for the modules in the [user
vignettes](https://epiverse-trace.github.io/ColOpenData/).
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-dev-utils.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test_that("release_bullets() returns what usethis expects", {
expect_type(release_bullets(), "character")
})
3 changes: 1 addition & 2 deletions vignettes/documentation_and_dictionaries.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,11 @@ name_to_code_mun("Boyacá", "Tunja")
```

::: {style="text-align: justify;"}
These individual codes can be used to filter information in the datasets.
These individual codes can be used to filter information in the datasets.

On the other hand, departments' and municipalities' codes can be translated to retrieve their official names using `divipola_municipality_name` and `divipola_department_name`.
:::

```{r tunja name}
code_to_name_mun("15001")
```

6 changes: 3 additions & 3 deletions vignettes/geospatial_data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ knitr::kable(mgncnpv)
::: {style="text-align: justify;"}
In this vignette you will learn:

1. How to download geospatial data using **ColOpenData**
2. How to use census data included in geospatial datasets
3. How to visualize spatial data using **leaflet** and **ggplot2**
1. How to download geospatial data using **ColOpenData**
2. How to use census data included in geospatial datasets
3. How to visualize spatial data using **leaflet** and **ggplot2**

We will be using geospatial data at the level of Municipality (MPIO) for the department of Tolima and we will calculate the percentage of houses with internet connection at each municipality. Later, we will build some plots using the previously mentioned approaches for dynamic and static plots.

Expand Down

0 comments on commit ff9c60f

Please sign in to comment.