Learn R Programming

imputeTS (version 1.5)

plotNA.distribution: Visualize Distribution of Missing Values

Description

Visualize the distribution of missing values within a time series. This is done as a barplot, which is especially useful if the time series would otherwise be too large to be plotted.

Usage

plotNA.distribution(x, colPoints = "steelblue",
  colBackgroundMV = "indianred2", main = "Distribution of NAs",
  xlab = "Time", ylab = "Value", pch = 20, cexPoints = 0.8,
  col = "black", ...)

Arguments

x
Numeric Vector (vector) or Time Series (ts) object containing NAs
colPoints
Color of the points for each observation
colBackgroundMV
Color for the background for the NA sequences
main
Main label for the plot
xlab
Label for x axis of the plot
ylab
Label for y axis of plot
pch
Plotting 'character', i.e., symbol to use.
cexPoints
character (or symbol) expansion: a numerical vector.
col
Color for the lines.
...
Additional graphical parameters that can be passed through to plot

Details

This function visualizes the distribution of missing values within a time series. In comparison to the plotNA.distribution function this is not done by plotting each observation of the time series seperatly. Instead observations for time intervals are represented as bars. For these intervals information about the amount of missing values are shown. This has the advantage, that also for large time series a plot which is easy to overview can be created.

See Also

plotNA.distributionBar, plotNA.gapsize, plotNA.imputations

Examples

Run this code
#Prerequisite: Load a time series with missing values
x <- tsAirgap

#Example 1: Visualize the missing values in this time series
plotNA.distribution(x)

Run the code above in your browser using DataLab