Skip to content

Commit

Permalink
Re #26 Updates for cran submission.
Browse files Browse the repository at this point in the history
  • Loading branch information
sempwn committed Sep 13, 2023
1 parent 9a4c890 commit 10d59d8
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 77 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ vignettes/*.pdf
.Renviron
docs
inst/doc

# Reverse dependency check files
revdep/*
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export(model_random_walk_data)
export(plot_kit_use)
import(Rcpp)
import(methods)
importFrom(RcppParallel,RcppParallelLibs)
importFrom(magrittr,"%>%")
importFrom(rlang,":=")
importFrom(rstan,sampling)
importFrom(rstantools,rstan_config)
importFrom(stats,rbinom)
importFrom(stats,rnorm)
useDynLib(bennu, .registration = TRUE)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

* `kit_summary_table` created to provide a quick way of summarizing model
output by different strata

* `model_random_walk_data` created to more closely mimic Bayesian data
generating process

* `generate_model_data` deprecated as `model_random_walk_data` will supplant it
as way of generating simulation data to test properties of the model

* Updates to stan model to make it compliant to rstan 2.26 (#22)

# bennu 0.2.1

# bennu 0.2.0
Expand Down
2 changes: 2 additions & 0 deletions R/bennu-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#' @import methods
#' @import Rcpp
#' @importFrom rstan sampling
#' @importFrom rstantools rstan_config
#' @importFrom RcppParallel RcppParallelLibs
#'
#' @references
#' Stan Development Team (2020). RStan: the R interface to Stan. R package version 2.21.2. https://mc-stan.org
Expand Down
2 changes: 1 addition & 1 deletion R/generate_model_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' The probability of kit use in time is assumed to increase linearly in inverse
#' logit space at a constant rate `0.1`.
#' The probability of reporting for each month and region is iid distributed
#' \eqn{\text{logit}^{-1}(p) \sim N(2,5)} which produces a mean reporting rate
#' \eqn{logit^{-1}(p) \sim N(2,5)} which produces a mean reporting rate
#' of approximately 88%
#' @param N_t number of time-points
#' @param region_coeffs vector of coefficients for regions determining kit orders
Expand Down
1 change: 1 addition & 0 deletions R/utils-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ kit_summary_table <- function(fit, ..., data = NULL,


i <- sim_p <- times <- estimate <- Distributed <- Reported_Distributed <- NULL
sim_used <- Reported_Used <- Orders <- NULL

percent_func <- scales::percent_format(accuracy = accuracy)
comma_func <- scales::comma_format(accuracy = accuracy)
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ This example runs output for test data generated by the package:
library(bennu)
library(rstan)
#> Loading required package: StanHeaders
#> Loading required package: ggplot2
#> rstan (Version 2.21.2, GitRev: 2e1f913d3ca3)
#>
#> rstan version 2.26.22 (Stan version 2.26.1)
#> For execution on a local, multicore CPU with excess RAM we recommend calling
#> options(mc.cores = parallel::detectCores()).
#> To avoid recompilation of unchanged Stan programs, we recommend calling
#> rstan_options(auto_write = TRUE)
#> For within-chain threading using `reduce_sum()` or `map_rect()` Stan functions,
#> change `threads_per_chain` option:
#> rstan_options(threads_per_chain = 1)
#> Do not specify '-march=native' in 'LOCAL_CPPFLAGS' or a Makevars file
library(bayesplot)
#> This is bayesplot version 1.8.1
#> This is bayesplot version 1.10.0
#> - Online documentation and vignettes at mc-stan.org/bayesplot
#> - bayesplot theme set to bayesplot::theme_default()
#> * Does _not_ affect other ggplot2 plots
Expand Down
62 changes: 1 addition & 61 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,10 @@

Maintainer: 'Mike Irvine <mike.irvine@bccdc.ca>'

New submission

License components with restrictions and base license permitting such:
MIT + file LICENSE
File 'LICENSE':
MIT License

Copyright (c) 2022 bennu 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Possibly misspelled words in DESCRIPTION:
Naloxone (2:31)
naloxone (13:11, 13:58, 14:63)

> checking dependencies in R code ... NOTE
Namespaces in Imports field not imported from:
'RcppParallel' 'rstantools'
All declared Imports should be used.

> checking for GNU extensions in Makefiles ... NOTE
GNU make is a SystemRequirements.

> checking HTML version of manual ... NOTE
Skipping checking math rendering: package 'V8' unavailable

> checking for detritus in the temp directory ... NOTE
Found the following files/directories:
'lastMiKTeXException'

0 errors √ | 0 warnings √ | 5 notes x

-- bennu 0.1.0: CREATED

Build ID: bennu_0.1.0.tar.gz-12322482d4cc4946aeb968efd1be4ac9
Platform: Ubuntu Linux 20.04.1 LTS, R-release, GCC
Submitted: 12m 48s ago


-- bennu 0.1.0: CREATED

Build ID: bennu_0.1.0.tar.gz-9b81e15504e64acb86418451ca038812
Platform: Fedora Linux, R-devel, clang, gfortran
Submitted: 12m 48s ago

0 errors √ | 0 warnings √ | 1 notes x

-- bennu 0.1.0: CREATED

Build ID: bennu_0.1.0.tar.gz-5e986dc4ddca490cbb12f3f43b9e81be
Platform: Debian Linux, R-devel, GCC ASAN/UBSAN
Submitted: 12m 48s ago
2 changes: 1 addition & 1 deletion man/est_naloxone.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/est_naloxone_vec.Rd

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

Binary file modified man/figures/README-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions man/generate_model_data.Rd

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

16 changes: 8 additions & 8 deletions man/kit_summary_table.Rd

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

0 comments on commit 10d59d8

Please sign in to comment.