0
Hello !
I’ve been through the documentation data.table()
, but I still can’t fully understand.
How would this function, for a dt ?
for(i in 1:ncol(df1))
{
df1[,i] <- df1[,i] %>% iconv(from = 'UTF-8', to = 'latin1')
}
In a data.frame it converts all columns from UTF-8 to latin1.
Some simpler way ?
Thank you!
It may be easier to read the data with the function
fread()
which allows to define the encoding:fread('file.txt, encoding = "latin1")
?– Willian Vieira
Yes ! but it turns out that I imported a very large base and only now I tried to encoding. To import again will take. Then I’d like another way out.
– RxT
I found that answer: https://stackoverflow.com/questions/24492969/apply-encoding-to-entire-data-table
– RxT
Maybe
dt[, lapply(.SD, iconv, from = 'UTF-8', to = 'latin1')]
.– Rui Barradas