na_fill: Fill in NAs

View source: R/utility.R

na_fillR Documentation

Fill in NAs

Description

Replace NA entries in a vector by the last non-NA value. If the first entry of the vector is NA, it is replaced by the first non-NA value. If the vector passed as input doesn't contain NAs, it is returned as is.

Usage

na_fill(x)

Arguments

x

Vector in which NAs should be removed

Value

Copy of x in which NAs have been replaced by nearest available value.


TheoMichelot/hmmTMB documentation built on Dec. 13, 2024, 11:52 a.m.