R/convertdf_enc.R
convertdf_enc.RdConvert encoding of character and factor variables in a dataframe
convertdf_enc(x, from = "", to = "UTF-8", sub = NA, colnames = FALSE)An object with the data.frame
class (such as data.frame or sf)
A character string describing the current encoding.
A character string describing the target encoding.
character string. If not NA it is used to replace
any non-convertible bytes in the input. (This would normally be a
single character, but can be more.) If "byte", the indication is
"<xx>" with the hex code of the byte. If "Unicode"
and converting from UTF-8, the Unicode point in the form
"<U+xxxx>", or if c99, a C99-style escape
"\uxxxx".
Should column names be converted as well?
The original object, with character variables (and levels of (character) factor variables) converted to the specified encoding.
Encoding strings: all R platforms support "" (for the
encoding of the current
locale), "latin1" and "UTF-8".
See iconv for more information.
Other Data_handling_utilities:
csv_to_sqlite(),
df_factors_to_char()