na.remove: Remove Missing Values

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/na.remove.R

Description

Removes all missing values from a time series.

Usage

1

Arguments

x

Numeric Vector (vector) or Time Series (ts) object in which missing values shall be replaced

Details

Removes all missing values from a input time series. This shortens the time series by the number of missing values in the series. Should be handled with care, because this can affect the seasonality of the time series. Seasonal patterns might be destroyed. Independent from the input, this function only returns a vector. (the time information of a resulting time series object wouldn't be correct any more).

Value

Vector (vector)

Author(s)

Steffen Moritz

See Also

na.interpolation, na.kalman, na.locf, na.ma, na.mean, na.random, na.replace, na.seadec, na.seasplit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#Example 1: Remove all NAs
#Create Time series with missing values
x <- ts(c(2,3,NA,5,6,NA,7,8))

#Remove all NAs
na.remove(x)


#Example 2: Remove all NAs in tsAirgap
na.remove(tsAirgap)

imputeTS documentation built on March 21, 2018, 1:04 a.m.