EVOLUTION-MANAGER
Edit File: zap_missing.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Zap special missings to regular R missings</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for zap_missing {haven}"><tr><td>zap_missing {haven}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Zap special missings to regular R missings</h2> <h3>Description</h3> <p>This is useful if you want to convert tagged missing values from SAS or Stata, or user-defined missings from SPSS, to regular R <code>NA</code>. </p> <h3>Usage</h3> <pre> zap_missing(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A vector or data frame</p> </td></tr> </table> <h3>Examples</h3> <pre> x1 <- labelled( c(1, 5, tagged_na("a", "b")), c(Unknown = tagged_na("a"), Refused = tagged_na("b")) ) x1 zap_missing(x1) x2 <- labelled_spss( c(1, 2, 1, 99), c(missing = 99), na_value = 99 ) x2 zap_missing(x2) # You can also apply to data frames df <- tibble::tibble(x1, x2, y = 4:1) df zap_missing(df) </pre> <hr /><div style="text-align: center;">[Package <em>haven</em> version 2.3.1 <a href="00Index.html">Index</a>]</div> </body></html>