Skip to content

Commit 6132c59

Browse files
Merge pull request #12 from OxfordIHTM/dev
spell check and create utils functions
2 parents c8c4043 + ae18af4 commit 6132c59

18 files changed

+243
-109
lines changed

.github/CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Contributing
2+
3+
## Bugs
4+
5+
* Submit an issue on the [issues page](https://github.com/OxfordIHTM/codeditr/issues)
6+
7+
## Code contributions
8+
9+
* Fork this repository to your Github account
10+
11+
* Clone your version on your account down to your machine from your account
12+
13+
```
14+
git clone https://github.com/<yourgithubusername>/codeditr.git
15+
```
16+
17+
* Make sure to track progress upstream i.e., on our version of `codeditr`
18+
at `OxfordIHTM/codeditr`, by doing
19+
20+
```
21+
git remote add upstream https://github.com/OxfordIHTM/codeditr.git
22+
```
23+
24+
* Before making changes make sure to pull changes in from `upstream` by doing
25+
either `git fetch upstream` then merge later or `git pull upstream` to fetch
26+
and merge in one step
27+
28+
* Make your changes on a new feature branch
29+
30+
* Please write a test or tests for your changes if they affect code and not just
31+
documentation
32+
33+
* Push up changes to your account
34+
35+
* Submit a pull request at `OxfordIHTM/codeditr`

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ jobs:
4747
- uses: r-lib/actions/check-r-package@v2
4848
with:
4949
upload-snapshots: true
50+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/test-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
if: always()
4040
run: |
4141
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
42+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4343
shell: bash
4444

4545
- name: Upload test results

DESCRIPTION

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
Package: codeditr
22
Type: Package
3-
Title: Implementing Basic Checks on Cause-of-Death Data Based on World Health
4-
Organization's CoDEdit Tool
3+
Title: Implementing Cause-of-Death Data Checks Based on the WHO CoDEdit Tool
54
Version: 0.0.0.9000
65
Authors@R: c(
7-
person("Anita", "Makori", email = "mark@brixtonhealth.com",
8-
role = c("aut", "cph")),
6+
person("Anita", "Makori", role = c("aut", "cph")),
97
person("Ernest", "Guevarra",
108
comment = c(ORCID = "0000-0002-4887-4415"),
11-
email = "ernest@guevarra.io", role = c("aut", "cre", "cph")))
9+
email = "ernest@guevarra.io", role = c("aut", "cre", "cph")),
10+
person("Sanjeev", "Pugazhendhi", role = c("ths", "rev")),
11+
person("Williams", "Udoh Ituen-Umanah", role = "rev"),
12+
person("Proochista", "Ariana", role = c("rev", "cph")))
1213
Description: The World Health Organization's CoDEdit electronic tool is intended
1314
to help producers of cause-of-death statistics in strengthening their
1415
capacity to perform routine checks on their data. This package ports the
15-
original tool built using Microsoft Acess into R so as to leverage the
16+
original tool built using Microsoft Access into R so as to leverage the
1617
utility and function of the original tool into a usable application
1718
program interface that can be used for building more universal tools or for
1819
creating programmatic scientific workflows aimed at routine, automated, and
1920
large-scale monitoring of cause-of-death data.
2021
License: GPL (>= 3)
2122
Depends:
2223
R (>= 2.10)
24+
Suggests:
25+
covr,
26+
spelling
2327
Encoding: UTF-8
28+
Language: en-GB
2429
LazyData: true
25-
RoxygenNote: 7.2.3
26-
Suggests:
27-
covr
30+
RoxygenNote: 7.3.1
31+
Roxygen: list(markdown = TRUE)

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export(get_age_values)

R/codeditr-package.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#'
2+
#' Implementing Cause-of-Death Data Checks Based on the WHO CoDEdit Tool
3+
#'
4+
#' The World Health Organization's CoDEdit electronic tool is intended to help
5+
#' producers of cause-of-death statistics in strengthening their capacity to
6+
#' perform routine checks on their data. This package ports the original tool
7+
#' built using Microsoft Access into R so as to leverage the utility and
8+
#' function of the original tool into a usable application program interface
9+
#' that can be used for building more universal tools or for creating
10+
#' programmatic scientific workflows aimed at routine, automated, and
11+
#' large-scale monitoring of cause-of-death data quality.
12+
#'
13+
#' @docType package
14+
#' @keywords internal
15+
#' @name codeditr
16+
#'
17+
"_PACKAGE"

R/codeditr.R

Lines changed: 0 additions & 18 deletions
This file was deleted.

R/utils.R

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#'
2+
#' Get various age values for all three age types
3+
#'
4+
#' @param age_value An integer value for the age
5+
#' @param age_type The age type of the specified age value. Can be either
6+
#' *"D"* for day, *"M"* for month, or *"Y"* for year.
7+
#'
8+
#' @returns A named list of age values in days, months, and years.
9+
#'
10+
#' @examples
11+
#' get_age_values(1, "Y")
12+
#'
13+
#' @rdname get_age
14+
#' @export
15+
#'
16+
17+
get_age_values <- function(age_value, age_type = c("D", "M", "Y")) {
18+
if (age_value > 100 & age_type == "Y")
19+
warning(
20+
"Age value of greater than 100 for age type `year` has been provided. Please double check that these are correct inputs."
21+
)
22+
23+
if (age_value > 31 & age_type == "D")
24+
warning(
25+
"Age value of greater than 31 for age type `day` has been provided. Please double check that these are correct inputs."
26+
)
27+
28+
if (age_value > 12 & age_type == "M")
29+
warning(
30+
"Age value of greater than 12 for age type `month` has been provided. Please double check that these are correct inputs."
31+
)
32+
33+
if (age_type == "D")
34+
list(
35+
days = age_value,
36+
months = age_value / (365.25 / 12),
37+
years = age_value / 365.25
38+
)
39+
40+
if (age_type == "M")
41+
list(
42+
days = age_value * (365.25 / 12),
43+
months = age_value,
44+
years = age_value / 12
45+
)
46+
47+
if (age_type == "Y")
48+
list(
49+
days = age_value * 365.25,
50+
months = age_value * 12,
51+
years = age_value
52+
)
53+
}

README.Rmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ knitr::opts_chunk$set(
1313
)
1414
```
1515

16-
# codeditr: Implementing Basic Checks on Cause-of-Death Data Based on World Health Organization's CoDEdit Tool <img src='man/figures/logo.png' width='200px' align='right' />
16+
# codeditr: Implementing Cause-of-Death Data Checks Based on the WHO CoDEdit Tool <img src='man/figures/logo.png' width='200px' align='right' />
1717

1818
<!-- badges: start -->
1919
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
@@ -22,23 +22,23 @@ knitr::opts_chunk$set(
2222
[![Codecov test coverage](https://codecov.io/gh/OxfordIHTM/codeditr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/OxfordIHTM/codeditr?branch=main)
2323
<!-- badges: end -->
2424

25-
The [World Health Organization](https://www.who.int/)'s [CoDEdit electronic tool](https://www.who.int/standards/classifications/classification-of-diseases/services/codedit-tool) is intended to help producers of cause-of-death statistics in strengthening their capacity to perform routine checks on their data. This package ports the original tool built using Microsoft Acess into R so as to leverage the utility and function of the original tool into a usable application program interface that can be used for building more universal tools or for creating programmatic scientific workflows aimed at routine, automated, and large-scale monitoring of cause-of-death data.
25+
The [World Health Organization](https://www.who.int/)'s [CoDEdit electronic tool](https://www.who.int/standards/classifications/classification-of-diseases/services/codedit-tool) is intended to help producers of cause-of-death statistics in strengthening their capacity to perform routine checks on their data. This package ports the original tool built using Microsoft Access into R so as to leverage the utility and function of the original tool into a usable application program interface that can be used for building more universal tools or for creating programmatic scientific workflows aimed at routine, automated, and large-scale monitoring of cause-of-death data.
2626

2727
## What does `codeditr` do?
2828

29-
The `codeditr` package provides functions for implementing data quality checks on cause-of-death records. It is built upon the same heuristics and algorithms that the WHO CodEdit v2.0 electronic tool uses to evaluate quality of cause-of-death data produced and used by country level statisticians in charge of mortality reporting.
29+
The `codeditr` package provides functions for implementing data quality checks on cause-of-death records. It is built upon the same heuristics and algorithms that the WHO CoDEdit v2.0 electronic tool uses to evaluate quality of cause-of-death data produced and used by country level statisticians in charge of mortality reporting.
3030

3131
Through this package, end users will have the ability to programmatically create scientific workflows for research on cause-of-death data and their quality or build more open tools or applications for routine monitoring of cause-of-death data.
3232

3333
## Installation
3434

35-
`coeditr` is not yet on CRAN.
35+
`coeditr` is not yet on CRAN but can be installed through the [Oxford IHTM R-universe](https://oxfordihtm.r-universe.dev) with:
3636

37-
You can install the development version of `codeditr` from [GitHub](https://github.com/OxfordIHTM/codeditr) with:
38-
39-
```{r gh-installation1, eval = FALSE}
40-
if(!require(remotes)) install.packages("remotes")
41-
remotes::install_github("OxfordIHTM/codeditr")
37+
```{r install, eval = FALSE}
38+
install.packages(
39+
"codeditr",
40+
repos = c("https://oxfordihtm.r-universe.dev", "https://cloud.r-project.org")
41+
)
4242
```
4343

4444
then load `codeditr`
@@ -52,7 +52,7 @@ library(codeditr)
5252

5353
## Citation
5454

55-
If you find the `codeitr` package useful please cite using the suggested citation provided by a call to the `citation()` function as follows:
55+
If you find the `codeditr` package useful please cite using the suggested citation provided by a call to the `citation()` function as follows:
5656

5757
```{r citation}
5858
citation("codeditr")

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

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

4-
# codeditr: Implementing Basic Checks on Cause-of-Death Data Based on World Health Organization’s CoDEdit Tool <img src='man/figures/logo.png' width='200px' align='right' />
4+
# codeditr: Implementing Cause-of-Death Data Checks Based on the WHO CoDEdit Tool <img src='man/figures/logo.png' width='200px' align='right' />
55

66
<!-- badges: start -->
77

@@ -20,7 +20,7 @@ electronic
2020
tool](https://www.who.int/standards/classifications/classification-of-diseases/services/codedit-tool)
2121
is intended to help producers of cause-of-death statistics in
2222
strengthening their capacity to perform routine checks on their data.
23-
This package ports the original tool built using Microsoft Acess into R
23+
This package ports the original tool built using Microsoft Access into R
2424
so as to leverage the utility and function of the original tool into a
2525
usable application program interface that can be used for building more
2626
universal tools or for creating programmatic scientific workflows aimed
@@ -31,7 +31,7 @@ data.
3131

3232
The `codeditr` package provides functions for implementing data quality
3333
checks on cause-of-death records. It is built upon the same heuristics
34-
and algorithms that the WHO CodEdit v2.0 electronic tool uses to
34+
and algorithms that the WHO CoDEdit v2.0 electronic tool uses to
3535
evaluate quality of cause-of-death data produced and used by country
3636
level statisticians in charge of mortality reporting.
3737

@@ -42,14 +42,14 @@ applications for routine monitoring of cause-of-death data.
4242

4343
## Installation
4444

45-
`coeditr` is not yet on CRAN.
46-
47-
You can install the development version of `codeditr` from
48-
[GitHub](https://github.com/OxfordIHTM/codeditr) with:
45+
`coeditr` is not yet on CRAN but can be installed through the [Oxford
46+
IHTM R-universe](https://oxfordihtm.r-universe.dev) with:
4947

5048
``` r
51-
if(!require(remotes)) install.packages("remotes")
52-
remotes::install_github("OxfordIHTM/codeditr")
49+
install.packages(
50+
"codeditr",
51+
repos = c("https://oxfordihtm.r-universe.dev", "https://cloud.r-project.org")
52+
)
5353
```
5454

5555
then load `codeditr`
@@ -63,8 +63,9 @@ library(codeditr)
6363

6464
## Citation
6565

66-
If you find the `codeitr` package useful please cite using the suggested
67-
citation provided by a call to the `citation()` function as follows:
66+
If you find the `codeditr` package useful please cite using the
67+
suggested citation provided by a call to the `citation()` function as
68+
follows:
6869

6970
``` r
7071
citation("codeditr")

inst/CITATION

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
citHeader("To cite codeditr in publications use:")
2-
3-
citEntry(
4-
entry = "Manual",
5-
title = "codeditr: Implementing Basic Checks on Cause-of-Death Data Based on World Health Organization's CoDEdit Tool",
1+
bibentry(
2+
bibtype = "Manual",
3+
header = "To cite codeditr in publications use:",
4+
title = "codeditr: Implementing Cause-of-Death Data Checks Based on World Health Organization's CoDEdit Tool",
65
author = c(person("Anita Makori"), person("Ernest Guevarra")),
76
year = "2024",
87
note = "R package version 0.0.9000",
9-
url = "https://oxford-ihtm.io/codeditr/",
10-
textVersion = paste(
11-
paste("Anita Makori and Ernest Guevarra (2024).",
12-
"codeditr: Implementing Basic Checks on Cause-of-Death Data Based on World Health Organization's CoDEdit Tool.",
13-
"R package version 0.0.9000.",
14-
"URL https://oxford-ihtm.io/codeditr/")
15-
)
8+
url = "https://oxford-ihtm.io/codeditr/"
169
)

inst/WORDLIST

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CMD
2+
CoDEdit
3+
Codecov
4+
FreeId
5+
ICD
6+
IHTM
7+
Ituen
8+
Lifecycle
9+
ORCID
10+
Udoh
11+
Umanah
12+
WIP
13+
codedit
14+
int
15+
www
16+
’s

man/codeditr.Rd

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/codeitr.Rd

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)