Visualize Distribution of NA gap sizes (NAs in a row) in a time series
plotNA.gapsize(x, limit = 10, byTotalNA = FALSE, legend = TRUE,
col = c("indianred", "steelblue"),
xlab = "Ranking of the different gap sizes", ylab = "Number",
main = "Occurrence of gap sizes (NAs in a row)", cex.names = 0.7,
horiz = FALSE, axes = TRUE, beside = TRUE, las = 1, ...)
Specifies how many of the top gap sizes are shown in the plot.
For byTotalNA = TRUE the top gap sizes according to their overall weight are shown. (occurrence * gap size) For byTotalNA = FALSE the top gap sizes are shown by their number of occurrence. (occurrence)
If TRUE a legend is shown at the bottom of the plot. A custom legend can be obtained by
setting this parameter to FALSE and using legend
function
A vector of colors for the bars or bar components.
Label for x axis of the plot
Label for y axis of plot
Main title for the plot
Expansion factor for axis names (bar labels).
A logical value. If FALSE, the bars are drawn vertically with the first bar to the left. If TRUE, the bars are drawn horizontally with the first at the bottom.
Logical. If TRUE, a vertical (or horizontal, if horiz is true) axis is drawn.
A logical value. If FALSE, the columns of height are portrayed as stacked bars, and if TRUE the columns are portrayed as juxtaposed bars.
Numeric in 0,1,2,3; the style of axis labels. 0:always parallel to the axis, 1:always horizontal, 2:always perpendicular to the axis, 3:always vertical.
Additional graphical parameters that can be passed through to barplot
This plotting function can be used to visualize the length of the NA gaps (NAs in a row) in a time series. It shows a ranking of which gap sizes occur most often. This ranking can be ordered by total NAs for this gap size (occurrence * gap length) or by occurrence of the gap size. The outcome will be somethink like in the time series 2NAs in a row occurred 27times, 4NAs in a row occurred 11 times, 7NAs in a row occurred 5 times, 1NA in a row occurred 3 times, ... .
plotNA.distribution
,plotNA.distributionBar
,
plotNA.imputations
#Example 1: Visualize the top gap sizes in tsNH4
plotNA.gapsize(tsNH4)
#Example 2: Visualize the top gap sizes in tsAirgap
plotNA.gapsize(tsAirgap)
Run the code above in your browser using DataLab