Skip to content

Updates for v0.2.0 release #181

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

Merged
merged 12 commits into from
Feb 20, 2025
Merged
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
5 changes: 0 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ jobs:
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Check website links
uses: untitaker/[email protected]
with:
args: docs/

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'merge_group' && github.event_name != 'pull_request'
uses: JamesIves/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ linters: all_linters(
packages = c("lintr", "etdev"),
object_name_linter = NULL,
implicit_integer_linter = NULL,
extraction_operator_linter = NULL,
todo_comment_linter = NULL,
library_call_linter = NULL,
undesirable_function_linter(
Expand All @@ -14,6 +13,7 @@ linters: all_linters(
),
function_argument_linter = NULL,
indentation_linter = NULL, # unstable as of lintr 3.1.0
one_call_pipe_linter = NULL,
# Use minimum R declared in DESCRIPTION or fall back to current R version.
# Install etdev package from https://github.com/epiverse-trace/etdev
backport_linter(if (length(x <- etdev::extract_min_r_version())) x else getRversion())
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cfr
Title: Estimate Disease Severity and Case Ascertainment
Version: 0.1.3
Version: 0.2.0
Authors@R: c(
person("Pratik R.", "Gupte", , "[email protected]", role = c("aut", "cph"),
comment = c(ORCID = "0000-0001-5294-7819")),
Expand Down Expand Up @@ -43,7 +43,7 @@ Suggests:
ggplot2,
incidence2,
knitr,
magrittr,
magrittr,
purrr,
rmarkdown,
scales,
Expand All @@ -58,4 +58,4 @@ Encoding: UTF-8
Language: en-GB
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2024-2025
YEAR: 2022-2025
COPYRIGHT HOLDER: cfr authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2024-2025 cfr authors
Copyright (c) 2022-2025 cfr authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 9 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# cfr (development version)
# cfr 0.2.0

# cfr 0.1.3
## New features

Added vignette `estimate_from_individual_data.Rmd` describing relationship between individual-level data and aggregate estimation.
* Added vignette `estimate_from_individual_data.Rmd` describing relationship between individual-level data and aggregate estimation (#170, @adamkucharski).

## Minor improvements and fixes

* Patch `unique(<difftime>)` for R-devel (v4.5.0) which now returns a `<difftime>` object instead of a `numeric`, so the `<difftime>` object is wrapped in `as.numeric()` as suggested by CRAN (#178, @adamkucharski).

* Update `<epiparameter>` class name in documentation (#166, @joshwlambert).

# cfr 0.1.2

Expand Down
3 changes: 2 additions & 1 deletion R/estimate_ascertainment.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ estimate_ascertainment <- function(data,
# throw a warning for ascertainment ration > 1.0
if (any(df_ascertainment > 1.0)) {
warning(
"Ascertainment ratios > 1.0 detected, setting these values to 1.0"
"Ascertainment ratios > 1.0 detected, setting these values to 1.0",
call. = FALSE
)
}
df_ascertainment[df_ascertainment > 1.0] <- 1.0
Expand Down
10 changes: 4 additions & 6 deletions R/prepare_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ prepare_data.incidence2 <- function(data, cases_variable = "cases",
stopifnot(
"`cases_variable` and `deaths_variable` should be in
`count_variable` column of <incidence2> object `data`" =
all(
c(cases_variable, deaths_variable) %in%
unique(data[[count_var_col]])
)
c(cases_variable, deaths_variable) %in%
unique(data[[count_var_col]])
)

# complete dates for all groups in the data and fill any NAs per user input
Expand All @@ -161,10 +159,10 @@ prepare_data.incidence2 <- function(data, cases_variable = "cases",
index <- index == cases_variable | index == deaths_variable
data <- data[index, ]

formula <- stats::reformulate(count_var_col, "...")
count_formula <- stats::reformulate(count_var_col, "...")
# cast wide and fill any NAs per user input
data <- data.table::dcast(
data, formula,
data, count_formula,
value.var = count_col
)

Expand Down
58 changes: 29 additions & 29 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,73 @@ Allarangar
Anoko
Aruna
Breman
Camacho
CFRs
CMD
COVID
Camacho
Codecov
Covid
DPG
EVD
EpiNow
Epiverse
GHA
HFR
Heesterbeek
IFR
Jonnie
Klinkenberg
Lifecycle
Mundeke
Nishiura
ORCID
PLOS
PMF
Piot
Poisson
Pratik
RepoStatus
SaMD
Sherratt
Tidyverse
Yahaya
Yokouide
coarseDataTools
codecov
Codecov
com
Covid
COVID
covidregionaldata
dbinom
dfrac
distcrete
doi
DPG
ebola
epiday
EpiNow
epiparameter
Epiverse
epiweek
etc
EVD
frac
geq
ggplot
gh
GHA
github
Heesterbeek
HFR
IFR
infty
io
Jonnie
Klinkenberg
leq
lifecycle
Lifecycle
linelist
lockdowns
md
Mundeke
Nishiura
np
ORCID
org
packagename
parameterise
parameterised
Piot
pkg
PLOS
PMF
Poisson
Pratik
RepoStatus
rightarrow
SaMD
Sherratt
sim
st
svg
th
Tidyverse
u
www
Yahaya
yaml
Yokouide
Binary file added pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon.ico
Binary file not shown.
888 changes: 888 additions & 0 deletions pkgdown/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions pkgdown/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added pkgdown/favicon/web-app-manifest-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/web-app-manifest-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 16 additions & 15 deletions revdep/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Platform

|field |value |
|:--------|:------------------------------------------------------------------------------------------|
|version |R version 4.3.2 (2023-10-31) |
|os |macOS Monterey 12.6.3 |
|system |x86_64, darwin20 |
|ui |RStudio |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |Europe/London |
|date |2024-09-11 |
|rstudio |2023.12.1+402 Ocean Storm (desktop) |
|pandoc |3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown) |
|field |value |
|:--------|:------------------------------------------|
|version |R version 4.4.2 (2024-10-31) |
|os |macOS Sequoia 15.0 |
|system |aarch64, darwin20 |
|ui |RStudio |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |Europe/London |
|date |2025-02-20 |
|rstudio |2024.04.1+748 Chocolate Cosmos (desktop) |
|pandoc |3.6.2 @ /opt/homebrew/bin/ (via rmarkdown) |

# Dependencies

|package |old |new |Δ |
|:---------|:-----|:-----|:--|
|cfr |0.1.1 |0.1.2 |* |
|checkmate |NA |2.3.2 |* |
|cfr |0.1.2 |0.1.3 |* |
|backports |1.5.0 |1.5.0 | |
|checkmate |2.3.2 |2.3.2 | |

# Revdeps

4 changes: 2 additions & 2 deletions vignettes/estimate_from_individual_data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pp <- 0.1 # Assumed CFR
set.seed(10) # Set seed for reproducibility

# Generate random case onset timings in Jan & Feb 2024
case_onsets <- as.Date("2024-01-01") + sample(1:60, nn, replace = TRUE)
case_onsets <- as.Date("2024-01-01") + sample.int(60, nn, replace = TRUE)

# Define current date of data availability (i.e. max follow up)
max_obs <- as.Date("2024-01-20")
Expand Down Expand Up @@ -175,7 +175,7 @@ data <- data.frame(
)

# Filter out unknown outcomes (after the max_obs date)
data <- data %>% filter(known_outcome != "")
data <- data %>% filter(nzchar(known_outcome))

# Arrange data by onset date
data <- data %>%
Expand Down
Loading