双引号和fread函数的问题

双引号和fread函数的问题,r,data.table,R,Data.table,我有一些列条目如下所示: c("This is just a "shame"...") # since its a character 这将在您的C:\驱动器上写入一个文件: sample.data <- data.frame(case1=c("This is just a 'shame'..."), case2="This is just a shame") # here I could not make it to insert

我有一些列条目如下所示:

c("This is just a "shame"...") # since its a character
这将在您的C:\驱动器上写入一个文件:

sample.data <- data.frame(case1=c("This is just a 'shame'..."), 
                          case2="This is just a shame") # here I could not make it to insert the double quotes 
write.csv(sample.data, file="C:/sample_data.csv")

require(data.table)
test.fread <- fread("C:/sample_data.csv")
test.read.csv <- read.csv("C:/sample_data.csv")
如果我使用
read.csv
则不会发生错误,并且条目读取正确

问题1:如何删除
字符
名称中的双引号


问题2:为什么read.csv正确读取条目,但
fread
失败

正如@Arun善意地建议的那样,github上当前的
data.table
开发版本1.9.5在这里可能会有所帮助

要安装,请遵循以下步骤(需要Rtools):

它已经过测试,因此这是为了确认最新版本的
data.table
使用双引号解决了问题,没有任何问题


有关更多详细信息和更新,请查看以下链接

谢谢,但我在读取的数据中有随机名称和多个条目,因此不能仅逃避条目。通常在R
引用单引号,反之亦然。请参阅@Michael:Thank,它似乎解释了一切。“不过,我必须核对我的数据。@Maximilian,你可以自己回答并接受它,这样对可能遇到这个问题的其他人有用。”。。(直到按1.9.6将1.9.5推到起重机上)。
Bumped column 79 to type character on data row 12681, field contains '   
a.n."'. Coercing previously read values in this column from logical, 
integer or numeric back to character which may not be lossless; e.g., if 
'00' and '000' occurred before they will now be just '0', and there 
may be inconsistencies with treatment of ',,' and ',NA,' too (if they 
occurred in this column before the bump). If this matters please rerun 
and set 'colClasses' to 'character' for this column. Please note that column
type detection uses the first 5 rows, the middle 5 rows and the 
last 5 rows, so hopefully this message should be very rare. 
If reporting to datatable-help, please rerun and include 
the output from verbose=TRUE.
# To install development version

library(devtools)
install_github("Rdatatable/data.table", build_vignettes = FALSE)