| na.pass0 | R Documentation |
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, ...)
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 |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.