Skip to content

Commit

Permalink
Merge pull request #80 from katilingban/dev
Browse files Browse the repository at this point in the history
update repository
  • Loading branch information
ernestguevarra authored Mar 3, 2024
2 parents 9892fb9 + 025a8bc commit 88f825b
Show file tree
Hide file tree
Showing 121 changed files with 2,110 additions and 759 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
^docs/$
^\.github$
^pkgdown$
^_pkgdown\.yml$
3 changes: 2 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -47,3 +47,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
8 changes: 4 additions & 4 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -31,20 +31,20 @@ jobs:
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/revdep/data.sqlite
/revdep/library
/revdep/library.noindex
docs
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: ppitables
Type: Package
Title: Lookup Tables to Generate Poverty Likelihoods and Rates using the Poverty
Probability Index (PPI)
Version: 0.5.5
Version: 0.5.4.9000
Authors@R: person("Ernest", "Guevarra",
comment = c(ORCID = "0000-0002-4887-4415"),
email = "ernestgmd@gmail.com", role = c("aut", "cre"))
Expand Down Expand Up @@ -31,6 +31,6 @@ Suggests:
Encoding: UTF-8
Language: en-GB
LazyData: true
RoxygenNote: 7.2.1
URL: https://github.com/katilingban/ppitables
RoxygenNote: 7.3.1
URL: https://github.com/katilingban/ppitables,https://katilingban.io/ppitables/
BugReports: https://github.com/katilingban/ppitables/issues
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ knitr::opts_chunk$set(
library(ppitables)
```

# ppitables: Lookup Tables to Generate Poverty Likelihoods and Rates using the Poverty Probability Index (PPI)
# ppitables: Lookup Tables to Generate Poverty Likelihoods and Rates using the Poverty Probability Index (PPI) <img src="man/figures/logo.png" width="200" align="right" />

<!--- BEGIN BADGES --->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
Expand All @@ -25,7 +25,7 @@ library(ppitables)
[![CRAN](http://cranlogs.r-pkg.org/badges/grand-total/ppitables)](https://CRAN.R-project.org/package=ppitables)
[![R-CMD-check](https://github.com/katilingban/ppitables/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/katilingban/ppitables/actions/workflows/R-CMD-check.yaml)
![test-coverage](https://github.com/katilingban/ppitables/workflows/test-coverage/badge.svg)
[![Coverage Status](https://img.shields.io/codecov/c/github/katilingban/ppitables/master.svg)](https://codecov.io/github/katilingban/ppitables?branch=master)
[![Codecov test coverage](https://codecov.io/gh/katilingban/ppitables/branch/main/graph/badge.svg)](https://app.codecov.io/gh/katilingban/ppitables?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/katilingban/ppitables/badge)](https://www.codefactor.io/repository/github/katilingban/ppitables)
[![DOI](https://zenodo.org/badge/121277287.svg)](https://zenodo.org/badge/latestdoi/121277287)
<!--- END BADGES --->
Expand Down
80 changes: 39 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

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

# ppitables: Lookup Tables to Generate Poverty Likelihoods and Rates using the Poverty Probability Index (PPI)
# ppitables: Lookup Tables to Generate Poverty Likelihoods and Rates using the Poverty Probability Index (PPI) <img src="man/figures/logo.png" width="200" align="right" />

<!--- BEGIN BADGES --->

Expand All @@ -18,8 +18,8 @@ checks](https://cranchecks.info/badges/summary/ppitables)](https://cran.r-projec
[![CRAN](http://cranlogs.r-pkg.org/badges/grand-total/ppitables)](https://CRAN.R-project.org/package=ppitables)
[![R-CMD-check](https://github.com/katilingban/ppitables/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/katilingban/ppitables/actions/workflows/R-CMD-check.yaml)
![test-coverage](https://github.com/katilingban/ppitables/workflows/test-coverage/badge.svg)
[![Coverage
Status](https://img.shields.io/codecov/c/github/katilingban/ppitables/master.svg)](https://codecov.io/github/katilingban/ppitables?branch=master)
[![Codecov test
coverage](https://codecov.io/gh/katilingban/ppitables/branch/main/graph/badge.svg)](https://app.codecov.io/gh/katilingban/ppitables?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/katilingban/ppitables/badge)](https://www.codefactor.io/repository/github/katilingban/ppitables)
[![DOI](https://zenodo.org/badge/121277287.svg)](https://zenodo.org/badge/latestdoi/121277287)
<!--- END BADGES --->
Expand Down Expand Up @@ -88,11 +88,11 @@ the PPI [site](https://www.povertyindex.org).

### List of PPI country tables

<table>
<table style="width:98%;">
<colgroup>
<col style="width: 6%" />
<col style="width: 18%" />
<col style="width: 56%" />
<col style="width: 55%" />
<col style="width: 18%" />
</colgroup>
<thead>
Expand Down Expand Up @@ -864,20 +864,19 @@ command in R:
``` r
find_table()
#> # A tibble: 91 × 7
#> region country surve…¹ relea…² descr…³ type filen…⁴
#> <chr> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Asia Afghan… 2007 2012 PPI fo… sps ppiAFG…
#> 2 Africa Angola 2008 2015 PPI fo… sps ppiAGO…
#> 3 Asia Bangla… 2010 2013 PPI fo… sps ppiBEN…
#> 4 Africa Benin 2010 2012 PPI fo… sps ppiBGD…
#> 5 Latin American and the Carribe… Bolivia 2013 2015 PPI fo… sps ppiBOL…
#> 6 Latin American and the Carribe… Brazil 2008 2010 PPI fo… sps ppiBRA…
#> 7 Africa Burkin… 2003 2011 PPI fo… sps ppiBFA…
#> 8 Africa Burkin… 2014 2017 PPI fo… sps ppiBFA…
#> 9 Africa Burkin… 2014 2017 PPI fo… ipa ppiBFA…
#> 10 Asia Cambod… 2011 2015 PPI fo… sps ppiKHM…
#> # … with 81 more rows, and abbreviated variable names ¹​survey_year,
#> # ²​release_year, ³​description, ⁴​filename
#> region country survey_year release_year description type filename
#> <chr> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Asia Afghan… 2007 2012 PPI for Af… sps ppiAFG2…
#> 2 Africa Angola 2008 2015 PPI for An… sps ppiAGO2…
#> 3 Asia Bangla… 2010 2013 PPI for Be… sps ppiBEN2…
#> 4 Africa Benin 2010 2012 PPI for Ba… sps ppiBGD2…
#> 5 Latin American a… Bolivia 2013 2015 PPI for Bo… sps ppiBOL2…
#> 6 Latin American a… Brazil 2008 2010 PPI for Br… sps ppiBRA2…
#> 7 Africa Burkin… 2003 2011 PPI for Bu… sps ppiBFA2…
#> 8 Africa Burkin… 2014 2017 PPI for Bu… sps ppiBFA2…
#> 9 Africa Burkin… 2014 2017 PPI for Bu… ipa ppiBFA2…
#> 10 Asia Cambod… 2011 2015 PPI for Ca… sps ppiKHM2…
#> # ℹ 81 more rows
```

View the list of PPI country tables for Africa using the following
Expand All @@ -886,19 +885,19 @@ command in R:
``` r
find_table(region = "Africa")
#> # A tibble: 39 × 7
#> region country survey_year release_year description type filen…¹
#> <chr> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Africa Angola 2008 2015 PPI for Angola b… sps ppiAGO
#> 2 Africa Benin 2010 2012 PPI for Banglade… sps ppiBGD
#> 3 Africa Burkina Faso 2003 2011 PPI for Burkina … sps ppiBFA
#> 4 Africa Burkina Faso 2014 2017 PPI for Burkina … sps ppiBFA
#> 5 Africa Burkina Faso 2014 2017 PPI for Burkina … ipa ppiBFA
#> 6 Africa Cameroon 2007 2013 PPI for Cameroon… sps ppiCMR
#> 7 Africa Cote d'Ivoire 2008 2013 PPI for Ivory Co… sps ppiCIV
#> 8 Africa Cote d'Ivoire 2015 2018 PPI for Ivory Co… ipa ppiCIV
#> 9 Africa Ethiopia 2010 2016 PPI for Ethiopia… sps ppiETH
#> 10 Africa Ghana 2012 2015 PPI for Ghana ba… sps ppiGHA
#> # … with 29 more rows, and abbreviated variable name ¹​filename
#> region country survey_year release_year description type filename
#> <chr> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Africa Angola 2008 2015 PPI for Angola … sps ppiAGO2
#> 2 Africa Benin 2010 2012 PPI for Banglad… sps ppiBGD2
#> 3 Africa Burkina Faso 2003 2011 PPI for Burkina… sps ppiBFA2
#> 4 Africa Burkina Faso 2014 2017 PPI for Burkina… sps ppiBFA2
#> 5 Africa Burkina Faso 2014 2017 PPI for Burkina… ipa ppiBFA2
#> 6 Africa Cameroon 2007 2013 PPI for Cameroo… sps ppiCMR2
#> 7 Africa Cote d'Ivoire 2008 2013 PPI for Ivory C… sps ppiCIV2
#> 8 Africa Cote d'Ivoire 2015 2018 PPI for Ivory C… ipa ppiCIV2
#> 9 Africa Ethiopia 2010 2016 PPI for Ethiopi… sps ppiETH2
#> 10 Africa Ghana 2012 2015 PPI for Ghana b… sps ppiGHA2
#> # 29 more rows
```

View the list of PPI country tables in Zambia using the the following
Expand All @@ -907,13 +906,12 @@ command in R:
``` r
find_table(country = "Zambia")
#> # A tibble: 4 × 7
#> region country survey_year release_year description type filen…¹
#> <chr> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Africa Zambia 2010 2013 PPI for Zambia based on… sps ppiZMB…
#> 2 Africa Zambia 2010 2013 PPI for Zambia based on… sps ppiZMB…
#> 3 Africa Zambia 2015 2017 PPI for Zambia based on… sps ppiZMB…
#> 4 Africa Zambia 2015 2017 PPI for Zambia based on… ipa ppiZMB…
#> # … with abbreviated variable name ¹​filename
#> region country survey_year release_year description type filename
#> <chr> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Africa Zambia 2010 2013 PPI for Zambia based o… sps ppiZMB2…
#> 2 Africa Zambia 2010 2013 PPI for Zambia based o… sps ppiZMB2…
#> 3 Africa Zambia 2015 2017 PPI for Zambia based o… sps ppiZMB2…
#> 4 Africa Zambia 2015 2017 PPI for Zambia based o… ipa ppiZMB2…
```

To extract the actual PPI tables, the `get_table()` function can be
Expand All @@ -939,7 +937,7 @@ get_table()
#> 8 Afghanistan 2012 ppiAFG2012 sps 1 nu150 100
#> 9 Afghanistan 2012 ppiAFG2012 sps 1 nu200 100
#> 10 Afghanistan 2012 ppiAFG2012 sps 1 extreme 100
#> # … with 93,078 more rows
#> # 93,078 more rows
```

To get the actual PPI tables for all countries with PPI tables in
Expand All @@ -960,7 +958,7 @@ get_table(region = "Africa")
#> 8 Angola 2015 ppiAGO2015 sps 0 ppp500 100
#> 9 Angola 2015 ppiAGO2015 sps 1 nl100 100
#> 10 Angola 2015 ppiAGO2015 sps 1 nl150 100
#> # … with 44,112 more rows
#> # 44,112 more rows
```

## Disclaimer
Expand Down
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true
Loading

0 comments on commit 88f825b

Please sign in to comment.