Skip to content

Commit

Permalink
Merge branch 'main' into test-auto-doc-2
Browse files Browse the repository at this point in the history
  • Loading branch information
d-morrison authored Jul 15, 2024
2 parents 49c080d + bde2b98 commit bd69b24
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 58 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ allpopsamples_hlye.csv$
^serocalculator.*\.tgz$
^inst/extdata
^CRAN-SUBMISSION$
^README\.qmd$
^codecov\.yml$
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Suggests:
readr,
bookdown,
ggbeeswarm,
DT
DT,
spelling
LazyData: true
Encoding: UTF-8
URL: https://github.com/UCD-SERG/serocalculator, https://ucd-serg.github.io/serocalculator/
Expand Down
9 changes: 9 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ S3method(autoplot,pop_data)
S3method(autoplot,seroincidence)
S3method(autoplot,seroincidence.by)
S3method(autoplot,summary.seroincidence.by)
S3method(get_age,pop_data)
S3method(get_age_var,pop_data)
S3method(get_id,pop_data)
S3method(get_id_var,pop_data)
S3method(get_value,pop_data)
S3method(get_value_var,pop_data)
S3method(print,seroincidence)
S3method(print,seroincidence.by)
S3method(print,summary.seroincidence.by)
S3method(set_age,pop_data)
S3method(set_id,pop_data)
S3method(set_value,pop_data)
S3method(strata,seroincidence.by)
S3method(summary,pop_data)
S3method(summary,seroincidence)
Expand Down
10 changes: 10 additions & 0 deletions R/load_pop_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ get_age <- function(object, ...) {
UseMethod("get_age", object)
}

#' @export
get_age.pop_data <- function(object, ...) {
# get age data
age_data <- object %>% pull(attr(object, "age_var"))
Expand All @@ -61,6 +62,7 @@ get_age_var <- function(object, ...) {
UseMethod("get_age_var", object)
}

#' @export
get_age_var.pop_data <- function(object, ...) {
# get value attribute
age_var <- attributes(object)$age_var
Expand All @@ -72,6 +74,7 @@ get_value <- function(object, ...) {
UseMethod("get_value", object)
}

#' @export
get_value.pop_data <- function(object, ...) {
# get age data
value_data <- object %>% pull(attr(object, "value_var"))
Expand All @@ -83,6 +86,7 @@ get_value_var <- function(object, ...) {
UseMethod("get_value_var", object)
}

#' @export
get_value_var.pop_data <- function(object, ...) {
# get value attribute
value_var <- attributes(object)$value_var
Expand All @@ -94,6 +98,7 @@ get_id <- function(object, ...) {
UseMethod("get_id", object)
}

#' @export
get_id.pop_data <- function(object, ...) {
# get age data
id_data <- object %>% pull(attr(object, "id_var"))
Expand All @@ -105,17 +110,20 @@ get_id_var <- function(object, ...) {
UseMethod("get_id_var", object)
}

#' @export
get_id_var.pop_data <- function(object, ...) {
# get value attribute
id_var <- attributes(object)$id_var

return(id_var)
}


set_age <- function(object, ...) {
UseMethod("set_age", object)
}

#' @export
set_age.pop_data <- function(object, age = "Age", standardize = TRUE, ...) {
# check if age column exists
if (age %in% colnames(object)) {
Expand Down Expand Up @@ -163,6 +171,7 @@ set_value <- function(object, ...) {
UseMethod("set_value", object)
}

#' @export
set_value.pop_data <- function(object, value = "result", standardize = TRUE, ...) {
# check if value column exists
if (value %in% colnames(object)) {
Expand Down Expand Up @@ -209,6 +218,7 @@ set_id <- function(object, ...) {
UseMethod("set_id", object)
}

#' @export
set_id.pop_data <- function(object, id = "index_id", standardize = TRUE, ...) {
# check if id column exists
if (id %in% colnames(object)) {
Expand Down
109 changes: 56 additions & 53 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,134 +1,137 @@
Aga
AKU
al
Aga
Ang
Anik
BMC
Bonačić
Bordetella
CMD
Campylobacter
campylobacteriosis
Ceper
Chiang
CMD
De
de
der
devtools
df
Dhulikhel
Diekmann
doi
Duynhoven
Eijkeren
epidem
et
Falkenhorst
FIC
Falkenhorst
Fogarty
Friesema
fx
Gageldonk
Graaf
Gras
Grolemund
Hassen
Heijden
hemolysin
Hessians
HlyE
IgA
IgG
IgM
isos
isotype
isotypes
Jernberg
jinf
jitter
Juba
Juma
Kamenskaya
kDa
KGH
Kamenskaya
Kretzschmar
Krogfelt
Kuusi
Linneberg
Marinović
mc
mcmc
Melker
Mertens
modelled
Molbak
Monge
Mughini
Muktadir
multicohort
Munira
Nadu
NIAID
NLL
nr
Orientia
Nadu
OSF
param
params
Pebody
Orientia
PLoS
pmed
Pebody
Polina
RStudio
Rai
recombinant
Roord
RStudio
Rtools
Rumunu
SErologic
Sadkowska
Saha
Saiful
Sajib
Sarkar
savePath
Schellekens
Seidman
Senjuti
Sero
Seroincidence
Serological
Simonsen
Sira
Sium
Strid
Syed
TW
Todys
Valk
Vellore
Versteegh
Wetering
Wiens
Zota
al
behaviour
campylobacteriosis
de
der
devtools
doi
epidem
et
fx
hemolysin
isos
isotype
isotypes
jinf
jitter
kDa
mc
mcmc
modelled
multicohort
nr
param
params
pmed
recombinant
savePath
seroconversion
seroconversions
seroepidemiology
Seroincidence
seroincidence
seroincidences
SErologic
serologic
Serological
serological
seroresponse
seroresponses
serosurvey
serosurveys
Simonsen
Sira
Sium
smp
smpl
Strid
subfigures
Syed
tbl
tibble
titers
Todys
tsutsugamushi
TW
unstratified
Valk
varepsilon
Vellore
Versteegh
Wetering
Wiens
Zota

SeroEpidemiology
callout
codecov
geoms
ggproto
3 changes: 3 additions & 0 deletions tests/spelling.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if(requireNamespace('spelling', quietly = TRUE))
spelling::spell_check_test(vignettes = TRUE, error = TRUE,
skip_on_cran = TRUE)
8 changes: 4 additions & 4 deletions vignettes/articles/enteric_fever_example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ bibliography: references.bib
---
## Introduction

This vignette provides users with an example analysis using the [**serocalculator**](https://github.com/UCD-SERG/serocalculator) package by reproducing the analysis for: [**Estimating typhoid incidence from community-based serosurveys: a multicohort study**](https://www.thelancet.com/journals/lanmic/article/PIIS2666-5247(22)00114-8/fulltext) (@Aiemjoy_2022_Lancet). We review the methods underlying the analysis and then walk through an example of enteric fever incidence in Pakistan. Note that because this is a simplied version of the analysis, the results here will differ slightly from those presented in the publication.
This vignette provides users with an example analysis using the [**serocalculator**](https://github.com/UCD-SERG/serocalculator) package by reproducing the analysis for: [**Estimating typhoid incidence from community-based serosurveys: a multicohort study**](https://www.thelancet.com/journals/lanmic/article/PIIS2666-5247(22)00114-8/fulltext) (@Aiemjoy_2022_Lancet). We review the methods underlying the analysis and then walk through an example of enteric fever incidence in Pakistan. Note that because this is a simplified version of the analysis, the results here will differ slightly from those presented in the publication.

In this example, users will determine the seroincidence of enteric fever in cross-sectional serosurveys conducted as part of the the SeroEpidemiology and Environmental Surveillance (SEES) for enteric fever study in Bangladesh, Nepal, and Pakistan. Longitudinal antibody responses were modeled from 1420 blood culture-confirmed enteric fever cases enrolled from the same countries.
In this example, users will determine the seroincidence of enteric fever in cross-sectional serosurveys conducted as part of the SeroEpidemiology and Environmental Surveillance (SEES) for enteric fever study in Bangladesh, Nepal, and Pakistan. Longitudinal antibody responses were modeled from 1420 blood culture-confirmed enteric fever cases enrolled from the same countries.


```{r, include = FALSE}
Expand All @@ -33,8 +33,8 @@ knitr::opts_chunk$set(
### Load packages
The first step in conducting this analysis is to load our necessary packages. If you haven't installed already, you will need to do so before loading.

```{r setup, message=FALSE}
# devtools::install_github("ucd-serg/serocalculator", eval=FALSE)
```{r setup, eval=FALSE}
# devtools::install_github("ucd-serg/serocalculator")
```


Expand Down

0 comments on commit bd69b24

Please sign in to comment.