Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencarlislewalker committed Feb 26, 2024
1 parent d3c5655 commit c4bf378
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 13 deletions.
2 changes: 1 addition & 1 deletion R/iidda.analysis/R/pipeline_dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @export
browse_pipeline_dependencies = function(dataset_ids
, dependency_types = c("IsCompiledBy", "IsDerivedFrom", "References")
, metadata = iidda.api::ops$metadata(dataset_ids = dataset_ids)
, metadata = iidda.api::ops_staging$metadata(dataset_ids = dataset_ids)
) {
dataset_ids = unique(dataset_ids)
if (length(dataset_ids) > 1L) {
Expand Down
25 changes: 24 additions & 1 deletion R/iidda.analysis/R/plot_prep.R
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,24 @@ ComputeMovingAverage <- function(ma_window_length=52){
}
}


#' Period Aggregator
#'
#' Create function that aggregates information over time periods, normalizes
#' a count variable, and creates new fields to summarize this information.
#'
#' @param time_variable Name of the variable to characterize the temporal
#' location of the time period.
#' @param period_width_variable Name of variable to characterize the width
#' of the time period.
#' @param count_variable Name of variable to characterize the count variable
#' being normalized.
#' @param norm_variable Name of variable to be used to normalize the count
#' variable.
#' @param rate_variable Name of variable to be used to store the normalized
#' count variable.
#' @param norm_exponent Exponent to use in normalization. The default is `5`,
#' which means `per 100,000`.
#'
#' @export
PeriodAggregator = function(
time_variable = "period_mid_time"
Expand Down Expand Up @@ -594,6 +611,12 @@ PeriodAggregator = function(
}
}

#' Time Scale Picker
#'
#' @param time_scale_variable Variable identifying the time scale of records.
#' The values of such a variable should be things like `"wk"`, `"mn"`, `"yr"`.
#' @param time_group_variable Variable identifying a grouping variable for
#' the time scales (e.g. a column identifying the year.).
#' @export
TimeScalePicker = function(
time_scale_variable = "time_scale"
Expand Down
10 changes: 5 additions & 5 deletions R/iidda.analysis/R/regex_query_tools.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Get field names for iidda queries
#'
#' @param response_type Character, one of `metadata`, `columns`, or
#' @param response_type Character, one of `metadata`, `columns`, or
#' `data_dictionary`
#' @param data_type Character, one of `cdi`, `CDI`, or `Communicable Disease
#' Incidence` for disease incidence time series datasets, or `pop`, `Pop`, or
#' `Population` for historical demographic census datasets"
#'
#' @return A Vector of field names, or if `response_type = "data_dictionary"`, a
#' @return A Vector of field names, or if `response_type = "data_dictionary"`, a
#' named list
#'
#' @importFrom stats na.omit
Expand Down Expand Up @@ -52,7 +52,7 @@ query_options <- function(response_type = c("metadata"
if(!(data_type %in% c("Communicable Disease Incidence", "Population"))){
stop(message = "`datatype` must be one of `cdi`, `CDI`, or `Communicable Disease Incidence` for disease incidence time series datasets, or `pop`, `Pop`, or `Population` for historical demographic census datasets")}
# query metadata
met <- iidda.api::ops$metadata(
met <- iidda.api::ops_staging$metadata(
response_type = response_type
, metadata_search = data_type
, key = ".types .resourceType"
Expand All @@ -78,7 +78,7 @@ query_options <- function(response_type = c("metadata"
#' @param entries List returned by \code{iidda.api::ops$metadata}
#' @param metadata_search Character, field from which unique tokens are desired
#'
#' @return Character vector of unique tokens for a given field from all iidda
#' @return Character vector of unique tokens for a given field from all iidda
#' datasets

unique_entries <- function(entries, metadata_search){
Expand Down Expand Up @@ -120,7 +120,7 @@ unique_field_entries <- function(response_type = c("metadata"
, string_comparison = "contains"
, sort = TRUE
){
entries <- iidda.api::ops$metadata(response_type = response_type
entries <- iidda.api::ops_staging$metadata(response_type = response_type
, metadata_search = metadata_search
, string_comparison = string_comparison)
ue <- unique_entries(entries, metadata_search = metadata_search)
Expand Down
38 changes: 38 additions & 0 deletions R/iidda.analysis/man/PeriodAggregator.Rd

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

21 changes: 21 additions & 0 deletions R/iidda.analysis/man/TimeScalePicker.Rd

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

2 changes: 1 addition & 1 deletion R/iidda.analysis/man/browse_pipeline_dependencies.Rd

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

2 changes: 1 addition & 1 deletion R/iidda.analysis/man/flexi_filter.Rd

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

4 changes: 2 additions & 2 deletions R/iidda.analysis/man/query_options.Rd

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

2 changes: 1 addition & 1 deletion R/iidda.analysis/man/unique_entries.Rd

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

2 changes: 1 addition & 1 deletion R/iidda.analysis/man/unique_field_entries.Rd

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

0 comments on commit c4bf378

Please sign in to comment.