Description Usage Arguments Value Author(s) References See Also Examples
base::factor()
does not let you use duplicated levels nicely.
It results in an ugly warning message and you need to use base::droplevels()
to get the desired output. The "solution" is to first factor the vector, and
then use a named list
with the base::levels()
function. This function is
a wrapper around those steps.
1 2 3 4 5 6 |
invec |
A |
levels |
A named |
store |
Logical. Should the input values be stored as an attribute? |
... |
Additional arguments to |
x |
The object to be printed. |
A factored variable with class
of factor
and Factor
, optionally
with an attribute
of "Input"
which stores the original input values.
Ananda Mahto
http://stackoverflow.com/a/19410249/1270695
base::factor()
, base::levels()
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.