statsNA {imputeTS}R Documentation

Print Statistics about Missing Values

Description

Print summary stats about the distribution of missing values in a univariate time series.

Usage

statsNA(x, bins = 4, print_only = TRUE)

Arguments

x

Numeric Vector (vector) or Time Series (ts) object containing NAs

bins

Split number for bin stats. Number of bins the time series gets divided into. For each bin information about amount/percentage of missing values is printed. Default value is 4 - what means stats about the 1st,2nd,3rd,4th quarter of the time series are shown.

print_only

Choose if the function Prints or Returns. For print_only = TRUE the function has no return value and just prints out missing value stats. If print_only is changed to FALSE, nothing is printed and the function returns a list.Print gives a little bit more information, since the returned list does not include "Stats for Bins" and "overview NA series"

Details

Prints the following information about the missing values in the time series:

It is furthermore, important to note, that you are able to choose whether the function returns a list or prints the information only. (see description of parameter "print_only")

Value

A list containing the stats. Beware: Function gives only a return value if print_only = FALSE.

Author(s)

Steffen Moritz

See Also

ggplot_na_distribution, ggplot_na_distribution2, ggplot_na_gapsize

Examples

# Example 1: Print stats about the missing data in tsNH4
statsNA(tsNH4)

# Example 2: Return list with stats about the missing data in tsAirgap
statsNA(tsAirgap, print_only = FALSE)

# Example 3: Same as example 1, just written with pipe operator
tsNH4 %>% statsNA()

[Package imputeTS version 3.3 Index]