Skip to content

Commit

Permalink
address most of the CRAN issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pearsonca committed Oct 25, 2024
1 parent c79052a commit 692b48c
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 21 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Authors@R:
comment = c(ORCID = "0000-0002-0380-1503")),
person("Lucy", "Goodfellow", , "lucy.goodfellow@lshtm.ac.uk", role = c("aut"),
comment = c(ORCID = "0009-0004-0434-5863")))
Description: The `paramix` package provides a convenient framework for aggregating
Description: A convenient framework for aggregating
and disaggregating continuously varying parameters (for example, case fatality
ratio, with age) for proper parametrization of lower-resolution compartmental
models (for example, with broad age categories) and subsequent upscaling of
model outputs at high resolution (for example, as needed when calculating
model outputs to high resolution (for example, as needed when calculating
age-sensitive measures like years-life-lost).
License: MIT + file LICENSE
Encoding: UTF-8
Expand Down
6 changes: 1 addition & 5 deletions R/aggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
#' @param ... any number of numeric vectors
#'
#' @return a sorted numeric vector with unique values
#'
#' @examples
#' paramix:::make_partition(1:5)
#' paramix:::make_partition(5:1, 4, 6)
#'
#' @keywords internal
make_partition <- function(
...
) {
Expand Down
17 changes: 15 additions & 2 deletions R/plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#' uses `integrate()`
#'
#' @examples
#' # from Levin et al 2020 https://doi.org/10.1007/s10654-020-00698-1
#' # COVID IFR from Levin et al 2020 https://doi.org/10.1007/s10654-020-00698-1
#' f_param <- function(age_in_years) {
#' (10^(-3.27 + 0.0524 * age_in_years))/100
#' }
Expand Down Expand Up @@ -115,6 +115,19 @@ utils::globalVariables(c(
#'
#' @inheritParams blend
#'
#' @return a `data.table`, columns:
#' - `partition`, the feature point corresponding to the value
#' - `value`, the translated `model_outcomes_dt$value`
#' - `method`, a factor with levels indicating how feature points are selected,
#' and how `value` is weighted to those features:
#' * `f_mid`: features at the `alembic_dt` outcome partitions, each with
#' value corresponding to the total value of the corresponding model
#' partition, divided by the number of outcome partitions in that model
#' partition
#' * `f_mean`: ...
#' * `mean_f`: ...
#' * `wm_f`: the
#'
#' @examples
#' library(data.table)
#' f_param <- function(age_in_years) {
Expand Down Expand Up @@ -174,7 +187,7 @@ distill_summary <- function(
distill(alembic_dt, model_outcomes_dt)[, method := "wm_f"],
"new_from", "partition"
)
))
)[, method := factor(method)])

}

Expand Down
18 changes: 18 additions & 0 deletions man/distill_summary.Rd

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

6 changes: 1 addition & 5 deletions man/make_partition.Rd

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

2 changes: 1 addition & 1 deletion man/parameter_summary.Rd

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

2 changes: 1 addition & 1 deletion man/paramix-package.Rd

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

8 changes: 3 additions & 5 deletions vignettes/intro.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "Introductory Usage: `paramix`"
output: rmarkdown::html_vignette
output:
rmarkdown::html_vignette:
check_title: False
vignette: >
%\VignetteIndexEntry{paramix-intro}
%\VignetteEngine{knitr::rmarkdown}
Expand All @@ -12,10 +14,6 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
options(
scipen = 100000,
rmarkdown.html_vignette.check_title = FALSE
)
```

```{r setup, echo = FALSE}
Expand Down
Binary file modified vignettes/intro_files/figure-html/unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 692b48c

Please sign in to comment.