View source: R/cluster_functions.R
| generate_observed_expected | R Documentation |
Function takes an object of class 'NearbyClusterGrids', as returned from
gen_nearby_case_info(), and an object of class 'CaseGrids', as
returned from generate_case_grids(), and adds observed and expected
information.
generate_observed_expected(
nearby_counts,
case_grid,
adjust = FALSE,
adj_constant = 1
)
nearby_counts |
an object of class 'NearbyClusterGrids' |
case_grid |
an object of class 'CaseGrids' |
adjust |
boolean default TRUE, set to |
adj_constant |
numeric (default=1.0); this is the constant to be added
if |
a dataframe of class 'ObservedExpectedGrid', which is simply a data frame with the observed and expected calculation incorporated for all target locations
case_grid <- generate_case_grids(
example_count_data,
example_count_data[, max(date)]
)
nci <- gen_nearby_case_info(
cg = case_grid,
distance_matrix = county_distance_matrix("OH")[["distance_matrix"]],
distance_limit = 25
)
generate_observed_expected(
nearby_counts = nci,
case_grid = case_grid
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.