EVOLUTION-MANAGER
Edit File: fct_explicit_na.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: Make missing values explicit</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 fct_explicit_na {forcats}"><tr><td>fct_explicit_na {forcats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Make missing values explicit</h2> <h3>Description</h3> <p>This gives missing values an explicit factor level, ensuring that they appear in summaries and on plots. </p> <h3>Usage</h3> <pre> fct_explicit_na(f, na_level = "(Missing)") </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>f</code></td> <td> <p>A factor (or character vector).</p> </td></tr> <tr valign="top"><td><code>na_level</code></td> <td> <p>Level to use for missing values: this is what NAs will be changed to.</p> </td></tr> </table> <h3>Examples</h3> <pre> f1 <- factor(c("a", "a", NA, NA, "a", "b", NA, "c", "a", "c", "b")) fct_count(f1) f2 <- fct_explicit_na(f1) fct_count(f2) </pre> <hr /><div style="text-align: center;">[Package <em>forcats</em> version 0.5.0 <a href="00Index.html">Index</a>]</div> </body></html>