Learn R Programming

lava (version 1.9.3)

na.pass0: 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

Examples

Run this code
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)

Run the code above in your browser using DataLab