Learn R Programming

locits (version 1.7.7)

getridofendNA: Replaces all NAs in vector by 0

Description

Replaces all NAs in vector by 0

Usage

getridofendNA(x)

Value

The same vector as x but with NAs replaced by 0

Arguments

x

Vector that might contain NAs

Author

Guy Nason.

Details

Originally, this function did something more complex, but now it merely replaces NAs by 0

References

Nason, G.P. (2013) A test for second-order stationarity and approximate confidence intervals for localized autocovariances for locally stationary time series. J. R. Statist. Soc. B, 75, 879-904. tools:::Rd_expr_doi("10.1111/rssb.12015")

See Also

HwdS

Examples

Run this code
#
#
#
x <- c(3, 4, 6, NA, 3)
getridofendNA(x)
#[1] 3 4 6 0 3

Run the code above in your browser using DataLab