diff --git a/NAMESPACE b/NAMESPACE index b6920831..68763d04 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,3 +4,5 @@ export(add_two_numbers) export(download_from_azure_blob) export(fetch_blob_container) export(fetch_credential_from_env_var) +export(read_interval_pmf) +export(read_parameters) diff --git a/R/parameters.R b/R/parameters.R index b325b2f2..f086c971 100644 --- a/R/parameters.R +++ b/R/parameters.R @@ -200,6 +200,7 @@ read_interval_pmf <- function(path, } #' DuckDB date comparison fails if the dates are not in string format +#' @noRd stringify_date <- function(date) { if (inherits(date, "Date")) { format(date, "%Y-%m-%d") diff --git a/man/fetch_blob_container.Rd b/man/fetch_blob_container.Rd index 96307ed7..bcece11d 100644 --- a/man/fetch_blob_container.Rd +++ b/man/fetch_blob_container.Rd @@ -16,10 +16,10 @@ A Blob endpoint \description{ This \strong{impure} function depends on the environment variables: \itemize{ -\item TENANT_ID -\item SUBSCRIPTION -\item RESOURCE_GROUP -\item STORAGE_ACCOUNT +\item az_tenant_id +\item az_subscription_id +\item az_resource_group +\item az_storage_account } } \details{ diff --git a/man/read_interval_pmf.Rd b/man/read_interval_pmf.Rd new file mode 100644 index 00000000..85d6096f --- /dev/null +++ b/man/read_interval_pmf.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/parameters.R +\name{read_interval_pmf} +\alias{read_interval_pmf} +\title{Read parameter PMF into memory} +\usage{ +read_interval_pmf( + path, + disease = c("COVID-19", "Influenza", "test"), + as_of_date, + parameter = c("generation_interval", "delay", "right_truncation"), + state = NA +) +} +\arguments{ +\item{path}{A path to a local file} + +\item{disease}{One of "COVID-19" or "Influenza"} + +\item{as_of_date}{The parameters "as of" the date of the model run} + +\item{parameter}{One of "generation interval", "delay", or "right-truncation} + +\item{state}{An optional parameter to subset the query to a parameter with a +particular two-letter state abbrevation. Right now, the only parameter with +state-specific estimates is \code{right-truncation}.} +} +\value{ +A PMF vector +} +\description{ +Using DuckDB from a parquet file. The function expects the file to be in SCD2 +format with column names: +\itemize{ +\item parameter +\item geo_value +\item disease +\item start_date +\item end_date +\item value +} +} diff --git a/man/read_parameters.Rd b/man/read_parameters.Rd new file mode 100644 index 00000000..4cf65a6f --- /dev/null +++ b/man/read_parameters.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/parameters.R +\name{read_parameters} +\alias{read_parameters} +\title{Read in disease process parameters from an external file or files} +\usage{ +read_parameters( + generation_interval_path, + delay_interval_path, + right_truncation_path, + disease, + as_of_date, + state +) +} +\arguments{ +\item{generation_interval_path, delay_interval_path, right_truncation_path}{Path to a local file with the parameter PMF. See \link{read_interval_pmf} for +details on the file schema. The parameters can be in the same file or a +different file.} + +\item{disease}{One of \code{COVID-19} or \code{Influenza}} + +\item{as_of_date}{The date "as of" the run. Set for the current date for the +most up-to-to date version of the parameters and set to an earlier date to +use parameters from an earlier time period.} + +\item{state}{Used only for right-truncation, the two-letter uppercase state +abbrevation.} +} +\value{ +A named list with three PMFs. The list elements are named +\code{generation_interval}, \code{delay_interval}, and \code{right_truncation}. If a path +is +} +\description{ +Read in disease process parameters from an external file or files +}