Plot the Occurrence of Missing-Value Gap Sizes
Source:R/plot.check_na_gapsize.R
plot.anivis_check_na_gapsize.RdRenders a check_na_gapsize() result (from the anicheck package) as a
horizontal bar chart of how often each gap size occurs — an adaptation of
ggplot_na_gapsize() from the imputeTS package (Moritz & Gatscha, GPL-3).
For every gap length it draws the number of such gaps (indianred) and,
optionally, the total missing frames they account for (steelblue, the gap size
times its count). Bars are ranked so the most common (or most costly) gaps sit
on top; only the top limit are shown. With more than one group, each gets
its own panel.
Arguments
- x
A
check_na_gapsizeobject (from the anicheck package).- ...
Additional arguments (currently unused).
- ranked_by
Order bars by
"occurrence"(default, gap frequency) or"total"(resulting missing frames).- limit
Maximum number of gap sizes (bars) to show per group, keeping the top-ranked. Default
10.- include_total
Whether to add the steelblue “resulting NAs” bar alongside the occurrence bar. Default
TRUE.- mode
Either
"light"(default) or"dark"; passed totheme_animovement().
Details
The plot is built from an intermediate frame of class
anivis_check_na_gapsize_data produced by as_plot_data() — the staging step
that mirrors data_plot() in
see.