-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from CDCgov/dev
Version Bump 0.1 -> 0.2
- Loading branch information
Showing
72 changed files
with
2,126 additions
and
934 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^.*\.github$ | ||
^_pkgdown\.yml$ | ||
^docs$ | ||
^pkgdown$ | ||
^\.github$ | ||
^codecov\.yml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [ master, dev ] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
name: pkgdown | ||
|
||
jobs: | ||
pkgdown: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v1 | ||
|
||
- uses: r-lib/actions/setup-r@v1 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v1 | ||
with: | ||
extra-packages: pkgdown | ||
needs: website | ||
|
||
- name: Deploy package | ||
run: | | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "[email protected]" | ||
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/master/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] | ||
|
||
name: test-coverage | ||
|
||
jobs: | ||
test-coverage: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v1 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v1 | ||
with: | ||
extra-packages: covr | ||
|
||
- name: Test coverage | ||
run: covr::codecov() | ||
shell: Rscript {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.Rhistory | ||
.RData | ||
.Ruserdata | ||
docs |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
Package: SaviR | ||
Type: Package | ||
Title: ITF Analytics | ||
Version: 0.1.0 | ||
Author: Authors@R: person("Randy", "Yee", email = "[email protected]", role = c("aut", "cre")) | ||
Maintainer: Randy Yee <[email protected]> | ||
Title: ITF Situational Awareness and Visualization | ||
Version: 0.2.0 | ||
Authors@R: c( | ||
person("Sean", "Browning", email = "[email protected]", role = c("aut", "cre")), | ||
person("Kimberly", "Wong", email = "[email protected]", role = "aut"), | ||
person("Nartlada", "Chantharojwong", email = "[email protected]", role = "aut"), | ||
person("James", "Fuller", role = "aut"), | ||
person("Dante", "Bugli", role = "ctb"), | ||
person("Randy", "Yee", email = "[email protected]", role = "aut")) | ||
Description: Data access and management of open-source COVID data for the production of analytic datasets. | ||
License: Apache + file LICENSE | ||
Imports: | ||
|
@@ -25,6 +30,7 @@ Imports: | |
RcppRoll, | ||
cachem, | ||
data.table, | ||
openxlsx, | ||
magrittr, | ||
memoise, | ||
rgdal, | ||
|
@@ -34,13 +40,17 @@ Imports: | |
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.1.2 | ||
Roxygen: list(markdown = TRUE) | ||
Suggests: | ||
rmarkdown, | ||
htmltools, | ||
tidyr, | ||
webshot, | ||
knitr, | ||
vdiffr, | ||
testthat (>= 3.0.0) | ||
httr, | ||
testthat (>= 3.0.0), | ||
covr | ||
Config/testthat/edition: 3 | ||
Depends: | ||
R (>= 3.5.0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#' @title Carry-Forward vaccination metrics to latest date | ||
#' | ||
#' @param df (data.frame) Source data frame containing vaccine metrics from [get_vax()] | ||
#' @param ... (optional) (un-)quoted column names to carry forward. Overwrites standard variable set | ||
#' | ||
#' @return df with either columns in \code{...} carried forward, or default set | ||
#' @section Notes: | ||
#' By default, function carries forward the following (unless names are passed in \code{...}): | ||
#' \itemize{ | ||
#' \item{total_vaccinations}{} | ||
#' \item{people_vaccinated}{} | ||
#' \item{people_fully_vaccinated}{} | ||
#' \item{total_boosters}{} | ||
#' \item{total_vaccinations_per_hundred}{} | ||
#' \item{people_vaccinated_per_hundred}{} | ||
#' \item{people_fully_vaccinated_per_hundred}{} | ||
#' \item{total_boosters_per_hundred}{} | ||
#' } | ||
#' @export | ||
calc_vax_carryforward <- function(df, ...) { | ||
# Optionally specify vax cols by name if we want to be specific | ||
vax_cols <- rlang::enquos(...) | ||
|
||
# If not specified, just take standard set. | ||
if (!length(vax_cols)) { | ||
vaccine_col_str <- c( | ||
"total_vaccinations", "people_vaccinated", "people_fully_vaccinated", | ||
"total_boosters", "total_vaccinations_per_hundred", "people_vaccinated_per_hundred", | ||
"people_fully_vaccinated_per_hundred", "total_boosters_per_hundred" | ||
) | ||
|
||
vax_cols <- lapply(vaccine_col_str, as.name) | ||
} | ||
|
||
df %>% | ||
arrange(id, date) %>% | ||
group_by(id) %>% | ||
# Take any cols that | ||
mutate_at(vars(!!!vax_cols), zoo::na.locf, na.rm = FALSE) %>% | ||
ungroup() | ||
} |
Oops, something went wrong.