powered by
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.
na.pass0(object, na.action = na.omit, row.wise = FALSE, value = 0, ...)
data.frame, vector
function used to identify missing values
when true entire row is set to zero whenever a missing data is observed in that row
value to replace NAs with (default 0)
additional arguments to lower level functions
na.pass(), na.omit(), na.fail()
na.pass()
na.omit()
na.fail()
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