Skip to content

Commit

Permalink
Dev webrd (#32)
Browse files Browse the repository at this point in the history
* test epidemics

* changes to vignette

* testing epidemics

* testing site

* improved vignette

* improved vignette

* improved vignette

* improved vignette with contributions

* improved vignette with contributions

* improved vignette with refernces

* improved vignette with references

* improved vignette with use cases

* improved vignette with use cases

* improved vignette with use cases

* improved vignette with use cases

* improved vignette with use cases

* improved vignette with use cases

* improved vignette with use cases

* improved vignette with use cases

* improved vignette with use cases

* use cases

* use cases

* update preloaded package datasets. mydata and serodata contain a copy of the same dataset for the time being.

* add additional changes to add multiple datasets to the package.

* doc: add datasets documentation files.

* use cases

* adding veev panama

* adding chik 2015

* adding chik 2015

* removing unnecesary data

* correcting chik data for nicaragua

* correcting chagas data for Colombia

* correcting chagas data for Colombia

* doc: add mydata and serodata documentation and .R files.

* doc: add documentation files for the additional incorporated datasets chagas2012, chik2015 and veev2012.

* doc: add documentation files for the additional incorporated datasets chagas2012, chik2015 and veev2012.

---------

Co-authored-by: Zulma Cucunubá <[email protected]>
Co-authored-by: Zulma M Cucunubá <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2023
1 parent d80c1b9 commit 7e45541
Show file tree
Hide file tree
Showing 40 changed files with 1,077 additions and 161 deletions.
40 changes: 40 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing to serofoi

This outlines how to propose a change to serofoi.

## Making changes

If you want to make a change, it's a good idea to first file an issue and make sure someone from the team agrees that it’s needed.
If you’ve found a bug, please file an issue that illustrates the bug with a minimal
[reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed). See [bug report template](../.github/ISSUE_TEMPLATE/bug_report.md). If you have a feature request see [feature request](../.github/ISSUE_TEMPLATE/feature_request.md).

### Pull request process

See [pull request template](../.github/PULL_REQUEST_TEMPLATE/pull_request_template.md)

* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("epiverse-trace/serofoi", fork = TRUE)`.

* Install all development dependencies with `devtools::install_dev_deps()`, and then make sure the package passes R CMD check by running `devtools::check()`.
If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing.
* Create a Git branch for your pull request (PR). We recommend using `usethis::pr_init("brief-description-of-change")`.

* Make your changes, commit to git, and then create a PR by running `usethis::pr_push()`, and following the prompts in your browser.
The title of your PR should briefly describe the change.
The body of your PR should contain `Fixes #issue-number`.

* For user-facing changes, add a bullet to the top of `NEWS.md` (i.e. just below the first header). Follow the style described in <https://style.tidyverse.org/news.html>.

### Code style

* New code should follow the tidyverse [style guide](https://style.tidyverse.org).
You can use the [styler](https://CRAN.R-project.org/package=styler) package to apply these styles, but please don't restyle code that has nothing to do with your PR.

* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for documentation.

* We use [testthat](https://cran.r-project.org/package=testthat) for unit tests.
Contributions with test cases included are easier to accept.

## Code of Conduct

Please note that the serofoi 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.
46 changes: 46 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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 }}
steps:
- uses: actions/checkout@v3

- 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/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ tests/testthat/Rplots.pdf
t,
tests/testthat/extdata/plots/actual/*.png
tests/testthat/extdata/dataframes/actual/*.csv
docs
35 changes: 26 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,33 @@ Type: Package
Title: Estimates the Force-of-Infection of a given pathogen from population based sero-prevalence studies
Version: 0.1.0
Authors@R:
c(
person("Zulma M. Cucunubá", role = "aut"),
person("Ben Lambert", role = "aut"),
person("Pierre Nouvellet", role = "aut"),
person("N. T. Domínguez", role = c("aut", "cre"), email = "[email protected]")
)
c(
person(
given = "Zulma M.",
family = "Cucunubá",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "https://orcid.org/0000-0002-8165-3198")
),
person(
given = "Nicolás",
family = "Torres",
role = c("aut")
),
person(
given = "Ben",
family = "Lambert",
role = c("aut")
),
person(
given = "Pierre",
family = "Nouvellet",
role = c("aut")
)
)
Contributor: Miguel Gámez, Geraldine Gómez, Jaime A. Pavlich-Mariscal
Maintainer: The package maintainer <[email protected]>
Description: R package to estimate time-varying Force-of-Infection of a given pathogen from population based sero-prevalence studies on a bayesian framework.
Description: R package to estimate time-varying Force-of-Infection of a given pathogen from population based sero-prevalence studies using a bayesian framework.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand Down Expand Up @@ -43,5 +61,4 @@ Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
Additional_repositories:
https://mc-stan.org/r-packages/
URL: https://trace-lac.github.io/serofoi/
15 changes: 15 additions & 0 deletions R/chagas2012.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#' Seroprevalence data on serofoi
#'
#' Data from a serological surveys
#'
#' @docType data
#'
#' @usage chagas2012
#'
#' @format An object of class \code{"cross"}; see \code{\link[qtl]{read.cross}}.
#'
#' @keywords datasets
#'
#' @examples
#' chagas2012
"chagas2012"
6 changes: 3 additions & 3 deletions data/data_test.R → R/chik2015.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#'
#' @docType data
#'
#' @usage data_test
#' @usage chik2015
#'
#' @format An object of class \code{"cross"}; see \code{\link[qtl]{read.cross}}.
#'
#' @keywords datasets
#'
#' @examples
#' data_test
"serofoi"
#' chik2015
"chik2015"
5 changes: 2 additions & 3 deletions R/modelling.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# TODO For some reason, the examples cannot access the mydata variable
#' Run model
#' Run the specified stan model for the force-of-infection
#'
#' Runs the specified stan model for the force-of-infection
#' @param model_data A data frame containing the data from a seroprevalence survey.
#' This data frame must contain the following columns:
#' \tabular{ll}{
Expand Down Expand Up @@ -71,7 +70,7 @@ run_model <- function(model_data,
#' Save or load model
#'
#' This function determines whether the corresponding .RDS file of the selected model exists or not.
#' In case the .RDS file exists, it is read and returned; otherwise, the object model is created through the
#' In case the .RDS file exists, it is read and returned; otherwise, the object model is created through the
#' \link[rstan]{stan_model} function, saved as an .RDS file and returned as the output of the function.
#' @param model_name Name of the selected model. Current version provides three options:
#' \describe{
Expand Down
15 changes: 15 additions & 0 deletions R/mydata.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#' Seroprevalence data on serofoi
#'
#' Data from a serological surveys
#'
#' @docType data
#'
#' @usage mydata
#'
#' @format An object of class \code{"cross"}; see \code{\link[qtl]{read.cross}}.
#'
#' @keywords datasets
#'
#' @examples
#' mydata
"mydata"
15 changes: 15 additions & 0 deletions R/veev2012.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#' Seroprevalence data on serofoi
#'
#' Data from a serological surveys
#'
#' @docType data
#'
#' @usage veev2012
#'
#' @format An object of class \code{"cross"}; see \code{\link[qtl]{read.cross}}.
#'
#' @keywords datasets
#'
#' @examples
#' veev2012
"veev2012"
Loading

0 comments on commit 7e45541

Please sign in to comment.