View source: R/encode_decode.R
encode | R Documentation |
The encode()
function encodes selected variables in a data frame. It converts the variables to numeric type, sets labels from the original data, and returns the modified data frame.
encode(.data, ...)
.data |
The input data frame. |
... |
The variables to be encoded. |
A modified data frame with the selected variables encoded.
# Encode selected variables in the `mtcars` data frame
encode(mtcars, mpg, cyl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.