na.pass0: Handle Missing Values in Objects

View source: R/napass0.R

na.pass0R Documentation

Handle Missing Values in Objects

Description

Returns the object with missing data replaced by zeros. This is sometimes useful for example when working with inverse probability weighting of the complete-case data.

Usage

na.pass0(object, na.action = na.omit, row.wise = FALSE, value = 0, ...)

Arguments

object

data.frame, vector

na.action

function used to identify missing values

row.wise

when true entire row is set to zero whenever a missing data is observed in that row

value

value to replace NAs with (default 0)

...

additional arguments to lower level functions

See Also

na.pass(), na.omit(), na.fail()

Examples

d <- data.frame(y=c(1,1,NA,2,NA,2), r=c(1,1,0,1,1,1))
na.pass0(d)
glm(y ~ 1, weights=d$r, data=d, na.action=na.pass0)

lava documentation built on Oct. 23, 2026, 1:09 a.m.