Plot Outlier Series for a Single Region and Indicator
Source:R/plot.outlier.R
plot.cd_outlier_list.Rd
This method visualizes the time series of a specific indicator for a single region or district. It highlights outlier points beyond 5 MAD from the median.
Usage
# S3 method for class 'cd_outlier_list'
plot(x, region = NULL)
Arguments
- x
A
cd_outlier_list
object, typically fromlist_outlier_units()
.- region
Character. Name of the region or district to plot.
Details
The plot includes:
Observed indicator values (green line and dots)
Median trend (cyan dashed line)
Shaded band for the 5×MAD threshold
Red points for flagged outliers
This is intended for diagnostic plots during indicator validation or quality checks.
Examples
if (FALSE) { # \dontrun{
# Visualize outliers for 'pcv1' in Nakuru
dt %>%
list_outlier_units("pcv1") %>%
plot(region = "Nakuru")
} # }