Skip to contents

Plots the results of estimating wastewater prevalence of SARS-CoV-2. Optionally plots the results over time if given a date column.

Usage

# S3 method for provoc
autoplot(provoc_obj, date_col = NULL)

Arguments

provoc_obj

Resulting object of class provoc to be used in plotting.

date_col

Optional - if there's a date column, the results are plotted over time. This can be problematic if there are multiple samples at each time point.

Examples

data(Baaijens)
b10 <- Baaijens[Baaijens$sra %in% unique(Baijens$sra)[1:10], ]
#> Error in unique(Baijens$sra): object 'Baijens' not found
b10$mutations <- parse_mutations(b10$label)
#> Error in unique(labels): object 'b10' not found
res <- provoc(count / coverage ~ B.1.1.7 + B.1.617.2,
    data = b10, by = "sra")
#> Error in provoc(count/coverage ~ B.1.1.7 + B.1.617.2, data = b10, by = "sra"): object 'b10' not found
res$date <- lubridate::ymd(res$date)
#> Error in `$<-.data.frame`(`*tmp*`, date, value = structure(numeric(0), class = "Date")): replacement has 0 rows, data has 5
autoplot(res, date_col = "date")
#> Error in `[.data.frame`(provoc_obj, , date_col): undefined columns selected