Description Usage Arguments Examples
View source: R/as_numeric_factor.R
Shorthand to avoid the all-to-common bug of going straight from factor to numeric.
1 |
x |
factor to be converted to numeric |
1 2 3 4 5 6 7 | year = factor(1998:2004)
# bad
as.numeric(year)
# good
as.numeric(as.character(year))
# not much less typing, but no nesting (and it will auto-complete)
as_numeric_factor(year)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.