View source: R/library--analysis_tools--time_offset--Offset_Analysis_Plot.R
OffsetHeatmap | R Documentation |
Outputs a heatmap of the offset for variant / time windows and population size / region
OffsetHeatmap(
method,
timePeriods,
waste_df,
case_df,
pop_df,
covarstarts,
covarends,
covarnames,
list,
week,
lod = FALSE,
N1_column = N1,
N2_column = N2,
site_column = site,
date_column = date,
case_column = conf_case,
pop_column = pop
)
method |
Which analysis definds the offset (r squared, pearson, r squared offset, pearson offset, kendall offset, spearman offset) |
timePeriods |
Size of time windows in months (if 0 uses variants) |
waste_df |
DF of waste data must include: date, N1, N2 |
case_df |
DF of case data must include: date, conf_case |
pop_df |
dataframe where region and population info is stored |
covarstarts |
start of each split period |
covarends |
end of each split period |
covarnames |
name of each split group |
list |
y axis bins (population size or regions) |
week |
if true applies 7-day smoothing to case data |
lod |
if true removes all values below LOD (default false) |
N1_column |
name of N1 column |
N2_column |
name of N2 column |
site_column |
name of site column |
date_column |
name of date column |
case_column |
name of case column |
pop_column |
name of pop column |
ggplot plot object
data(WasteWater_data, package = "Covid19Wastewater")
data("Case_data", package = "Covid19Wastewater")
data(Pop_data, package = "Covid19Wastewater")
covarstarts <- c(as.Date("2020-08-17"),
as.Date("2021-03-29"))
covarends <- c(as.Date("2021-01-18"),
as.Date("2021-05-24"))
covarnames <- c("Robin1",
"Alpha.V1")
OffsetHeatmap("kendall_offset", 0, WasteWater_data, Case_data, Pop_data,
covarstarts, covarends, covarnames, "pop", TRUE, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.