Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New main features into refac #54

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ assignees: ''
Please place an "x" in all the boxes that apply
---------------------------------------------

- [ ] I have the most recent version of linelist and R
- [ ] I have the most recent version of vaccineff and R
- [ ] I have found a bug
- [ ] I have a [reproducible example](http://reprex.tidyverse.org/articles/reprex-dos-and-donts.html)
- [ ] I want to request a new feature
Expand Down
23 changes: 17 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@ Package: vaccineff
Title: Estimate Vaccine Effectiveness Based on Different Study Designs
Version: 0.0.1
Authors@R: c(
person(given = "Zulma M.", family = "Cucunubá", email = "zulma.cucunuba@javeriana.edu.co", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-8165-3198")),
person(given = "David Santiago", family = "Quevedo", email = "ex-dsquevedo@javeriana.edu.co", role = c("aut"),
comment = c(ORCID = "0000-0003-1583-4262")),
person(given = "Santiago", family = "Loaiza", email = "santiago.loaiza@javeriana.edu.co", role = c("aut"),
comment = c(ORCID = "0000-0002-2092-3262")),
person(given = "Zulma M.", family = "Cucunubá", email = "zulma.cucunuba@javeriana.edu.co", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-8165-3198")),
person("International Development Research Center (IDRC)", role = c("fnd")),
person(given = "Geraldine", family = "Gómez Millán", email = "geralidine.gomez@javeriana.edu.co", role = c("ctb"),
comment = c(ORCID = "0009-0007-8701-0568")),
person(given = "Pratik", family = "Gupte", email = "pratik.gupte@lshtm.ac.uk", role = c("ctb"),
comment = c(ORCID = "0000-0001-5294-7819"))
comment = c(ORCID = "0000-0001-5294-7819")),
person(given = "Érika J", family = "Cantor", email = "erika.cantor@javeriana.edu.co", role = c("ctb"),
comment = c(ORCID = "0000-0003-3320-6032")),
person(given = "Santiago", family = "Loaiza", email = "santiago.loaiza@javeriana.edu.co", role = c("ctb"),
comment = c(ORCID = "0000-0002-2092-3262")),
person(given = "Jaime", family = "Pavlich-Mariscal", email = "jpavlich@javeriana.edu.co", role = c("ctb"),
comment = c(ORCID = "0000-0002-3892-6680")),
person(given = "Hugo", family = "Gruson", email = "hugo.gruson@data.org", role = c("ctb"),
comment = c(ORCID = "0000-0002-4094-1476")),
person(given = "Chris", family = "Hartgerink", email = "chris@data.org", role = "ctb",
comment = c(ORCID = "0000-0003-1050-6809")),
person(given = "Felipe Segundo", family = "Abril", email = "fsabrilb@unal.edu.co", role = "ctb",
comment = c(ORCID = "0000-0002-2512-4929"))
)
Description: Estimate vaccine effectiveness based on different observational study designs, as discussed in Torvaldsen and McIntyre (2020) <doi:10.3316/informit.511798489353134>.
Description: R package with tools for estimating vaccine effectiveness and vaccine related metrics.
URL: https://github.com/epiverse-trace/vaccineff, https://epiverse-trace.github.io/vaccineff/
BugReports: https://github.com/epiverse-trace/vaccineff/issues
License: MIT + file LICENSE
Expand Down
18 changes: 6 additions & 12 deletions R/coh_matching.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,27 +173,21 @@ get_censoring_date_match <- function(data,
data,
min.rows = 1L
)

# check for string type
checkmate::assert_string(outcome_date_col)
checkmate::assert_string(censoring_date_col)

# check for names in data
checkmate::assert_names(
colnames(data),
must.include = c(outcome_date_col, censoring_date_col)
)
# check for subclass
checkmate::expect_names(
colnames(data),
must.include = "subclass",
info = "'subclass' column from match must be included in 'data' to \
identify matched couples."
must.include = c(outcome_date_col, censoring_date_col, "subclass")
)

# check for date type
checkmate::assert_date(data[[outcome_date_col]])
checkmate::assert_date(data[[censoring_date_col]])

# check for string type
checkmate::assert_string(outcome_date_col)
checkmate::assert_string(censoring_date_col)

# create censoring date for every couple indexed by subclass
censoring_date <- unlist(
tapply(data[[censoring_date_col]],
Expand Down
31 changes: 9 additions & 22 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,11 @@ knitr::opts_chunk$set(

<!-- badges: end -->

*{{ packagename }}* is an R package that offers tools for estimating the
vaccine effectiveness, using a series of epidemiological designs including cohort studies, test-negative case-control, and screening
methods [@torvaldsen2020]. The package provides a set of features for preparing the data,
to analyze different study designs and for assessing the performance of
the models.

*{{ packagename }}* is developed at [Pontificia Universidad Javeriana](https://www.javeriana.edu.co/inicio) as part of the
[Epiverse-TRACE initiative](https://data.org/initiatives/epiverse/).

*{{ packagename }}* is an R package that offers tools for estimating vaccine effectiveness, using a series of epidemiological designs including cohort studies, test-negative case-control, and screening methods [@torvaldsen2002]. The current version of the package provides a set of features for preparing, visualizing, and managing cohort data, estimating vaccine effectiveness, and assessing the performance of the models. Test-negative design and screening method will be included in future versions.

## Installation

The current development version of _{{ packagename }}_ can be installed from [GitHub](https://github.com/) using the `pak` package.
Expand All @@ -53,8 +49,8 @@ pak::pak("{{ gh_repo }}")
library(vaccineff)
```

*{{ packagename }}* provides minimal datasets that can be used to test out
each design `(cohortdata, testnegdata, screeningdata)`
*{{ packagename }}* provides a minimal cohort dataset that can be used to test out
the models.

```{r example, include = TRUE, echo = TRUE}
# Load example `cohortdata` included in the package
Expand All @@ -74,25 +70,16 @@ To report a bug or to request a new feature please open an [issue](https://githu

Contributions to _{{ packagename }}_ are welcomed. Please follow the [package contributing guide](https://github.com/{{ gh_repo }}/blob/main/.github/CONTRIBUTING.md).

## Code of conduct

Please note that the _{{ packagename }}_ 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.

## Contributions

Contributors to the project include:

- [David Santiago Quevedo](https://github.com/davidsantiagoquevedo)
(author)
**Authors**: [David Santiago Quevedo](https://github.com/davidsantiagoquevedo) and [Zulma M. Cucunubá](https://github.com/zmcucunuba) (maintainer)

- [Zulma M. Cucunubá](https://github.com/zmcucunuba) (author)
**Contributors**:
[Geraldine Gómez](https://github.com/GeraldineGomez), [Pratik Gupte](https://github.com/pratikunterwegs), [Érika J. Cantor](https://github.com/ErikaCantor), [Santiago Loaiza](https://github.com/santilo9513), [Jaime A. Pavlich-Mariscal](https://github.com/jpavlich), [Hugo Gruson](https://github.com/Bisaloo), [Chris Hartgerink](https://github.com/chartgerink), [Felipe Segundo Abril-Bermúdez](https://github.com/fsabrilb)

- [Santiago Loaiza](https://github.com/santilo9513) (author)

- [Geraldine Gómez](https://github.com/GeraldineGomez) (contributor)

- [Jaime A. Pavlich-Mariscal](https://github.com/jpavlich) (contributor)
## Code of conduct

- [Pratik Gupte](https://github.com/pratikunterwegs) (contributor)
Please note that the _{{ packagename }}_ 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.

## References
79 changes: 43 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ status](https://www.r-pkg.org/badges/version/vaccineff)](https://CRAN.R-project.

<!-- badges: end -->

*vaccineff* is an R package that offers tools for estimating the vaccine
effectiveness, using a series of epidemiological designs including
cohort studies, test-negative case-control, and screening methods
([Torvaldsen and McIntyre 2020](#ref-torvaldsen2020)). The package
provides a set of features for preparing the data, to analyze different
study designs and for assessing the performance of the models.

*vaccineff* is developed at [Pontificia Universidad
Javeriana](https://www.javeriana.edu.co/inicio) as part of the
[Epiverse-TRACE initiative](https://data.org/initiatives/epiverse/).

*vaccineff* is an R package that offers tools for estimating vaccine
effectiveness, using a series of epidemiological designs including
cohort studies, test-negative case-control, and screening methods
([Torvaldsen and McIntyre 2002](#ref-torvaldsen2002)). The current
version of the package provides a set of features for preparing,
visualizing, and managing cohort data, estimating vaccine effectiveness,
and assessing the performance of the models. Test-negative design and
screening method will be included in future versions.

## Installation

The current development version of *vaccineff* can be installed from
Expand All @@ -40,19 +42,25 @@ pak::pak("epiverse-trace/vaccineff")

## Quick start

*vaccineff* provides minimal datasets that can be used to test out each
design `(cohortdata, testnegdata, screeningdata)`
*vaccineff* provides a minimal cohort dataset that can be used to test
out the models.

``` r
# Load example `cohortdata` included in the package
data("cohortdata")
head(cohortdata, 5)
#> sex age subsidy death_date vaccine_date_1 vaccine_date_2 vaccine_1 vaccine_2
#> 1 F 6 0 <NA> <NA> <NA> <NA> <NA>
#> 2 M 79 0 <NA> 2044-03-31 2044-05-07 BRAND2 BRAND2
#> 3 F 34 0 <NA> 2044-07-26 2044-09-03 BRAND2 BRAND2
#> 4 M 26 0 <NA> <NA> <NA> <NA> <NA>
#> 5 F 66 0 <NA> 2044-05-20 2044-06-17 BRAND2 BRAND2
#> id sex age death_date death_other_causes vaccine_date_1 vaccine_date_2
#> 1 afade1b2 F 37 <NA> <NA> <NA> <NA>
#> 2 556c8c76 M 19 <NA> <NA> <NA> <NA>
#> 3 04edf85a M 50 <NA> <NA> <NA> <NA>
#> 4 7e51a18e F 8 <NA> <NA> <NA> <NA>
#> 5 c5a83f56 M 66 <NA> <NA> <NA> <NA>
#> vaccine_1 vaccine_2
#> 1 <NA> <NA>
#> 2 <NA> <NA>
#> 3 <NA> <NA>
#> 4 <NA> <NA>
#> 5 <NA> <NA>
```

## Package vignettes
Expand All @@ -73,40 +81,39 @@ Contributions to *vaccineff* are welcomed. Please follow the [package
contributing
guide](https://github.com/epiverse-trace/vaccineff/blob/main/.github/CONTRIBUTING.md).

Contributors to the project include:

**Authors**: [David Santiago
Quevedo](https://github.com/davidsantiagoquevedo) and [Zulma M.
Cucunubá](https://github.com/zmcucunuba) (maintainer)

**Contributors**: [Geraldine Gómez](https://github.com/GeraldineGomez),
[Pratik Gupte](https://github.com/pratikunterwegs), [Érika J.
Cantor](https://github.com/ErikaCantor), [Santiago
Loaiza](https://github.com/santilo9513), [Jaime A.
Pavlich-Mariscal](https://github.com/jpavlich), [Hugo
Gruson](https://github.com/Bisaloo), [Chris
Hartgerink](https://github.com/chartgerink), [Felipe Segundo
Abril-Bermúdez](https://github.com/fsabrilb)

## Code of conduct

Please note that the *vaccineff* 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.

## Contributions

Contributors to the project include:

- [David Santiago Quevedo](https://github.com/davidsantiagoquevedo)
(author)

- [Zulma M. Cucunubá](https://github.com/zmcucunuba) (author)

- [Santiago Loaiza](https://github.com/santilo9513) (author)

- [Geraldine Gómez](https://github.com/GeraldineGomez) (contributor)

- [Jaime A. Pavlich-Mariscal](https://github.com/jpavlich) (contributor)

- [Pratik Gupte](https://github.com/pratikunterwegs) (contributor)

## References

<div id="refs" class="references csl-bib-body hanging-indent">
<div id="refs" class="references csl-bib-body hanging-indent"
entry-spacing="0">

<div id="ref-torvaldsen2020" class="csl-entry">
<div id="ref-torvaldsen2002" class="csl-entry">

Torvaldsen, S., and P. B. McIntyre. 2020. “Observational Methods in
Torvaldsen, S., and P. B. McIntyre. 2002. “Observational Methods in
Epidemiologic Assessment of Vaccine Effectiveness.” *Communicable
Diseases Intelligence Quarterly Report* 26 (3).
<https://doi.org/10.3316/informit.511798489353134>.
<https://pubmed.ncbi.nlm.nih.gov/12416713/>.

</div>

Expand Down
4 changes: 4 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ steelblue
darkred
coh
MatchIt
Bermúdez
IDRC
Érika
funder
10 changes: 8 additions & 2 deletions man/vaccineff-package.Rd

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

2 changes: 1 addition & 1 deletion vignettes/references.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[
{"id":"torvaldsen2020","accessed":{"date-parts":[[2023,7,5]]},"author":[{"family":"Torvaldsen","given":"S."},{"family":"McIntyre","given":"P. B."}],"citation-key":"torvaldsen2020","container-title":"Communicable Diseases Intelligence Quarterly Report","DOI":"10.3316/informit.511798489353134","issue":"3","issued":{"date-parts":[[2020,8,23]]},"publisher":"Australian Government Department of Health","source":"search.informit.org (Atypon)","title":"Observational methods in epidemiologic assessment of vaccine effectiveness","type":"article-journal","URL":"https://search.informit.org/doi/abs/10.3316/INFORMIT.511798489353134","volume":"26"}
{"id":"torvaldsen2002","accessed":{"date-parts":[[2024,5,2]]},"author":[{"family":"Torvaldsen","given":"S."},{"family":"McIntyre","given":"P. B."}],"citation-key":"torvaldsen2002","container-title":"Communicable Diseases Intelligence Quarterly Report","issue":"3","issued":{"date-parts":[[2002,8,23]]},"publisher":"Australian Government Department of Health","source":"health.gov.au","title":"Observational methods in epidemiologic assessment of vaccine effectiveness","type":"article-journal","URL":"https://pubmed.ncbi.nlm.nih.gov/12416713/","volume":"26"}
]
Loading