Skip to content
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
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.6-6
Date: 2021-12-09 15:50:23 UTC
SHA: 9031cb87f2972541498e5b5a2d9b391066091cc8
Version: 0.7.2
Date: 2025-04-11 20:15:41 UTC
SHA: d8af1df1b780ebf57345882cddc53aaa1eb5bd67
11 changes: 6 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: coarseDataTools
Version: 0.7.1
Date: 2023-07-03
Version: 0.7.2
Date: 2025-04-09
Title: Analysis of Coarsely Observed Data
Authors@R: c(person("Nicholas G.", "Reich", email = "nick@umass.edu", role = c("aut", "cre")),
person("Justin", "Lessler", email = "jlessler@unc.edu", role = "aut"),
Expand All @@ -9,9 +9,10 @@ Authors@R: c(person("Nicholas G.", "Reich", email = "nick@umass.edu", role = c("
person("Hugo", "Gruson", email = "hugo.gruson@normalesup.org", role = "ctb"))
Maintainer: Nicholas G. Reich <nick@umass.edu>
License: GPL (>= 2)
URL: https://cran.r-project.org/package=coarseDataTools,
http://nickreich.github.io/coarseDataTools/
URL: http://nickreich.github.io/coarseDataTools/
Encoding: UTF-8
Depends:
R (>= 3.5.0)
Imports:
MCMCpack,
graphics,
Expand Down Expand Up @@ -39,4 +40,4 @@ Collate:
'sampleSizeSimulation.R'
'coarseDataTools-package.R'
VignetteBuilder: knitr
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# coarseDataTools 0.7.2

* update cross-reference link for CRAN compatibility

# coarseDataTools 0.7.1

* Added pkgdown, moved ChangeLog to NEWS.md
Expand Down
2 changes: 1 addition & 1 deletion R/coarseDataTools-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
##' @format A numeric vector with 134 positive values. Each value represents an exposure window length from an observation of the incubation period for that individual. The exposure window length is the length of time during which exposure could have occurred. For example, if an individual could have been exposed anytime between 6am on Monday to 6am on Wednesday, her exposure window length would be 2 days.
##'
##' @usage data(exp.win.lengths)
##' @source Lessler J et al. New England Journal of Medicine. Outbreak of 2009 Pandemic Influenza A (H1N1) at a New York City School. 2009. 361(27):2628-2636. \url{https://www.nejm.org/doi/full/10.1056/nejmoa0906089}
##' @source Lessler J et al. New England Journal of Medicine. Outbreak of 2009 Pandemic Influenza A (H1N1) at a New York City School. 2009. 361(27):2628-2636. \doi{10.1056/NEJMoa0906089}
##'
##' @examples
##' data(exp.win.lengths)
Expand Down
2 changes: 1 addition & 1 deletion R/dic.fit.mcmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
##' @param n.samples number of samples to draw from the posterior (after the burnin)
##' @param dist distribution to be used (L for log-normal,W for weibull, G for Gamma, and E for erlang, off1G for 1 day right shifted gamma)
##' @param seed seed for the random number generator for MCMC
##' @param ... additional parameters to \link{MCMCmetrop1R}
##' @param ... additional parameters to \link[MCMCpack]{MCMCmetrop1R}
##' @return a cd.fit.mcmc S4 object
##' @importFrom MCMCpack MCMCmetrop1R
##' @export
Expand All @@ -46,13 +46,13 @@
check.data.structure(dat)

## check to make sure distribution is supported
if (!dist %in% c("G", "W", "L", "E", "off1G", "off1W", "off1L")) stop("Please use one of the following distributions Log-Normal (L) , Weibull (W), Gamma (G), Erlang (E), offset Log-Normal (off1L), offset Weibull (off1W) or offset Gamma (off1G)")

Check warning on line 49 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=49,col=68,[condition_call_linter] Use stop(., call. = FALSE) not to display the call in an error message.

## ## don't need MCMCpack for Erlang
## if (dist != "E") require(MCMCpack)

## check that percentiles are valid
if (any(ptiles >= 1, ptiles <= 0)) stop("Sorry the percentiles you are requesting are not valid.")

Check warning on line 55 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=55,col=38,[condition_call_linter] Use stop(., call. = FALSE) not to display the call in an error message.

## default prior parameters if none specified
if (is.null(prior.par1)) {
Expand All @@ -78,7 +78,7 @@

## random seed based off current time if none specified
if (is.null(seed)) {
t <- as.numeric(Sys.time())

Check warning on line 81 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=81,col=5,[object_overwrite_linter] 't' is an exported object from package 'base'. Avoid re-using such symbols.
seed <- 1e8 * (t - floor(t))
}

Expand Down Expand Up @@ -135,7 +135,7 @@



if (!fail) {

Check warning on line 138 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=138,col=7,[if_not_else_linter] Prefer `if (A) x else y` to the less-readable `if (!A) y else x` in a simple if/else statement.
## untransform MCMC parameter draws to natural scale
untrans.mcmcs <- t(apply(mcmc.run[, 1:2], 1, function(x) dist.optim.untransform(dist = dist, pars = x)))

Expand All @@ -143,7 +143,7 @@
ptiles.appended <- sort(union(0.5, ptiles))
est.pars <- matrix(nrow = length(ptiles.appended) + 2, ncol = 3)

if (dist == "L") {

Check warning on line 146 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=146,col=5,[if_switch_linter] Prefer switch() statements over repeated if/else equality tests, e.g., switch(x, a = 1, b = 2) over if (x == "a") 1 else if (x == "b") 2.
par1.name <- "meanlog"
par2.name <- "sdlog"
mcmc.quantiles <- apply(untrans.mcmcs, 1, function(x) qlnorm(ptiles.appended, meanlog = x[1], sdlog = x[2]))
Expand Down Expand Up @@ -178,8 +178,8 @@
par2.name <- "scale"
mcmc.quantiles <- apply(untrans.mcmcs, 1, function(x) qgamma(ptiles.appended, shape = x[1], scale = x[2]))
} else {
stop("Sorry, unknown distribution type. Check the 'dist' option.")

Check warning on line 181 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=181,col=7,[condition_call_linter] Use stop(., call. = FALSE) not to display the call in an error message.
## not actually needed but just in case

Check warning on line 182 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=182,col=7,[unreachable_code_linter] Remove code and comments coming after return() or stop().
}

## make the return matrix
Expand Down Expand Up @@ -211,7 +211,7 @@
return(rc)
} else {
if (msg != "") msg <- paste0("Error: ", msg)
stop(sprintf("\n%s\nTry adjusting the starting parameters (init.pars), or changing the optimization method (opt.method).", msg))

Check warning on line 214 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=214,col=5,[condition_call_linter] Use stop(., call. = FALSE) not to display the call in an error message.
}
}

Expand Down Expand Up @@ -248,8 +248,8 @@
log = TRUE
)),
error = function(e) {
warning("Loglik failure, returning -Inf")

Check warning on line 251 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=251,col=9,[condition_call_linter] Use warning(., call. = FALSE) not to display the call in an error message.
return(-Inf)

Check warning on line 252 in R/dic.fit.mcmc.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/dic.fit.mcmc.R,line=252,col=9,[return_linter] Use implicit return behavior; explicit return() is not needed.
}
)
} else if (dist == "W" || dist == "off1W") {
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ coarseDataTools

<!-- badges: start -->
[![CRAN](http://cranlogs.r-pkg.org/badges/coarseDataTools)](https://cran.r-project.org/package=coarseDataTools)
[![Travis build status](https://travis-ci.org/nickreich/coarseDataTools.svg?branch=master)](https://travis-ci.org/nickreich/coarseDataTools)
[![R-CMD-check](https://github.com/nickreich/coarseDataTools/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nickreich/coarseDataTools/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

Expand Down
4 changes: 1 addition & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## updates in this edition

- updated vignette to Rmd/HTML
- fixed s4 documentation issue as requested from CRAN by removing method with problems
- fixed urls in citations
- fixed cross-reference to external package and other broken links
32 changes: 16 additions & 16 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ vers <- paste("R package version", meta$Version)

citHeader("To cite the R package 'coarseDataTools' in publications use:")

citEntry(entry = "Article",
title = "Estimating incubation periods with coarse data.",
author= c(person(c("Nicholas G"), "Reich"),
bibentry(bibtype = "Article",
title = "Estimating incubation periods with coarse data.",
author = c(person(c("Nicholas G"), "Reich"),
person(c("Justin"), "Lessler"),
person(c("Derek AT"), "Cummings"),
person(c("Ron"), "Brookmeyer")),
journal = "Statistics in Medicine",
year = 2009,
journal = "Statistics in Medicine",
year = 2009,
textVersion = "Reich NG, Lessler J, Cummings DAT, Brookmeyer R. (2009). Estimating incubation periods with coarse data. Statistics in Medicine. 28(22):2769--2784.")


citEntry(entry = "Article",
title = "Estimating absolute and relative case fatality ratios from infectious disease surveillance data.",
author= c(person(c("Nicholas G"), "Reich"),
bibentry(bibtype = "Article",
title = "Estimating absolute and relative case fatality ratios from infectious disease surveillance data.",
author = c(person(c("Nicholas G"), "Reich"),
person(c("Justin"), "Lessler"),
person(c("Derek AT"), "Cummings"),
person(c("Ron"), "Brookmeyer")),
journal = "Biometrics",
year = 2012,
journal = "Biometrics",
year = 2012,
textVersion = "Reich NG, Lessler J, Cummings DAT, Brookmeyer R. Estimating absolute and relative case fatality ratios from infectious disease surveillance data. Biometrics. 2012, 68(2): 598--606.")


citEntry(entry = "Manual",
title = "coarseDataTools: A collection of functions to help with analysis of coarsely observed data",
author= c(person(c("Nicholas G"), "Reich"),
bibentry(bibtype = "Manual",
title = "coarseDataTools: A collection of functions to help with analysis of coarsely observed data",
author = c(person(c("Nicholas G"), "Reich"),
person(c("Justin"), "Lessler"),
person(c("Andrew S"), "Azman")),
year = year,
note = vers,
url = meta$URL,
year = year,
note = vers,
url = meta$URL,
textVersion = paste0("Reich NG, Lessler J, Azman AS. (", year, "). coarseDataTools: A collection of functions to help with analysis of coarsely observed data. <", meta$URL, ">. ", vers, "."))
2 changes: 1 addition & 1 deletion man/dic.fit.mcmc.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/exp.win.lengths.Rd

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

Loading