na_ref | R Documentation |
Function that sets NA as factor reference level (if any NAs exist).
na_ref(var, ...)
var |
Vector to convert to factor |
... |
Additional arguments to pass to |
var
as a factor with NA as a reference level (if any exist).
no_na <- na_ref(1:10) with_na <- na_ref(c(NA, 1:10)) levels(no_na) levels(with_na)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.