Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是一个包含两个字符列的 CSV 文件:
"key","value" "a","\","
所有字符值都用双引号引起来。并且其中一个值中有一个序列\",(转义引号加定界符)。我无法通过 read.csv、readr 中的 read_csv 或 data.table 中的 fread 正确读取此文件。
\",
您可以使用readr's read_delim,它比 's 更通用read_csv:
readr
read_delim
read_csv
library(readr) read_delim('yourfile.csv', delim = ",", escape_double = FALSE, escape_backslash = TRUE)