plot.caseCounts {WhiteLabRt} | R Documentation |
This function plots the number of cases over time from a data frame object. If the data frame contains multiple locations, a specific location must be specified. The plot displays the total number of cases against dates and annotates one of the earliest points with the location name.
## S3 method for class 'caseCounts'
plot(x, loc = NULL, ...)
x |
A data frame containing the case counts with at least two columns: |
loc |
An optional string specifying the location to filter the case counts by. If |
... |
Additional arguments passed to the |
If the location
column is present in x
and contains multiple unique values,
the loc
parameter must be specified to indicate which location's data to plot.
The function adds a text annotation to the plot, labeling one of the earliest points
with the specified location's name.
a plot object for an object of class caseCounts
data("sample_dates")
data("sample_location")
data("sample_cases")
case_Counts = create_caseCounts(sample_dates, sample_location, sample_cases)
plot(case_Counts)