naOmit: Fast na.omit

View source: R/naOmit.R

naOmitR Documentation

Fast na.omit

Description

This function removes NAs from input vector, in contrast to na.omit this function has no slot for removed elements.

Usage

naOmit(x, silent = FALSE, debug = FALSE, callFrom = NULL)

Arguments

x

(vector or matrix) data to check & remove NAs

silent

(logical) suppress messages if TRUE

debug

(logical) additional messages for debugging

callFrom

(character) allows easier tracking of messages produced

Details

Resulting objects from naOmit are smaller in size and subsequent code execution (on large vectors) may be faster (in particular if many NAs get encountered). Note : This function behaves differently to na.omit with input other than plain vectors. Will not work with data.frames !

Value

This function returns a vector without NAs (matrix input will be transformed to vector). Returns NULL if input consists only of NAs.

See Also

na.fail, na.omit

Examples

aA <- c(11:13,NA,10,NA); 
naOmit(aA) 

wrMisc documentation built on March 9, 2026, 5:07 p.m.