gpt4 book ai didi

r - fread (data.table) 锁定文件

转载 作者:行者123 更新时间:2023-12-04 09:23:46 24 4
gpt4 key购买 nike

我用过fread来自 data.table包,当我尝试修改或删除文件(只用记事本打开)窗口说:

enter image description here

如何解锁此绑定(bind)?

编辑:

在 R 中尝试给出相同的结果

cat(file="C:/Users/MCarrie/Desktop/test/test2.txt")
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file 'C:/Users/MCarrie/Desktop/test/test2.txt': Permission denied

信息:
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] data.table_1.8.8

loaded via a namespace (and not attached):
[1] tools_3.0.1

> showConnections(all=T)
description class mode text isopen can read can write
0 "stdin" "terminal" "r" "text" "opened" "yes" "no"
1 "stdout" "terminal" "w" "text" "opened" "no" "yes"
2 "stderr" "terminal" "w" "text" "opened" "no" "yes"

正在读取的文件:(故意缺少报价)
"AA",3,4,5,"w"
"ss,2,3,4,"s"
"ww",2,3,3,"s"

最佳答案

请使用 data.table v1.8.11 重试。 data.table homepage 上有一个适用于 Windows 的新 .zip .

来自 NEWS :

If fread returns a data error (such as unbalanced quotes on a particular line) it now closes the file first rather than holding a lock open, a Windows only problem. Thanks to nigmastar for reporting and Carl Witthoft for the hint. Tests added.

关于r - fread (data.table) 锁定文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18597123/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com