2

这是 R 内存中数据编码的片段。CSV 文件是使用编码“Latin-1”读取的data.table::fread。正如这篇文章所暗示的,数据以不同的编码存储,这是不可取的,因为我会将数据留在 SQLite 数据库中,所以每当我将数据发送到数据库并回调它时,Latin-1 都不会被正确读取。有没有办法使这个正常化?一旦数据在 data.frame 的不同部分具有多种编码,似乎通用功能iconv将不起作用。

Encoding(Data$DESC)

 [5305] "unknown" "unknown" "unknown" "unknown" "unknown" "unknown"
 [5311] "unknown" "unknown" "unknown" "latin1"  "unknown" "unknown"
 [5317] "unknown" "latin1"  "latin1"  "latin1"  "latin1"  "unknown"
 [5323] "latin1"  "latin1"  "latin1"  "latin1"  "unknown" "latin1" 
4

0 回答 0