fillNAs: Forward fill NA values (vectorized implementation)

View source: R/helper.R

fillNAsR Documentation

Forward fill NA values (vectorized implementation)

Description

Efficiently fills NA values by carrying forward the last non-NA value. Uses vectorized operations for better performance than loop-based approaches.

Usage

fillNAs(x)

Arguments

x

Vector with NAs to fill

Value

Vector with NAs filled

Examples

## Not run: 
fillNAs(c(1, NA, NA, 2, NA, 3))  # Returns: c(1, 1, 1, 2, 2, 3)

## End(Not run)

reportRmd documentation built on March 20, 2026, 5:06 p.m.