可以在。它是在页面中间发现的单个文件。我打开了2021文件的ZIP文件,并将CSV重命名为2021,而不是2021.Q1-Q4.Singlefile。我尝试在记事本++中打开它,但说它太大了。另外,不能在Excel中打开它。我尝试以下代码,并在下面获取错误。这个错误告诉我它太大还是无法阅读?还使用命令,read.csv无济于事。有什么建议吗?我想在记事本++中打开它,并保存为2021.txt
msa2021 <-fread("S:/file_path/2021.csv")
Warning in (if (.Platform$OS.type == "unix") system else shell)(paste0("(", :
'(S:/file_path/2021.csv) >
C:\Users\someone\AppData\Local\Temp\3\RtmpqCvyUH\file2eac5c0526dd' execution failed with
error code 1
Warning in fread("S:file_path/2021.csv")
:
File 'C:\Users\someone\AppData\Local\Temp\3\RtmpqCvyUH\file2eac5c0526dd' has size 0. Returning a NULL data.table.

The data can be found at https://www.bls.gov/cew/downloadable-data-files.htm. It is the single file found in the middle of the page. I opened up the zip file for the 2021 file and renamed the csv to just 2021 instead of 2021.q1-q4.singlefile. I tried opening it in notepad ++ but it says that it is too large. Also, can't open it in excel. I try the following code and get the error below. Is this error telling me that it is too large or can't read it? Also use the command, read.csv to no avail. Any suggestions? I thought of opening it in Notepad ++ and doing a save as 2021.txt
msa2021 <-fread("S:/file_path/2021.csv")
Warning in (if (.Platform$OS.type == "unix") system else shell)(paste0("(", :
'(S:/file_path/2021.csv) >
C:\Users\someone\AppData\Local\Temp\3\RtmpqCvyUH\file2eac5c0526dd' execution failed with
error code 1
Warning in fread("S:file_path/2021.csv")
:
File 'C:\Users\someone\AppData\Local\Temp\3\RtmpqCvyUH\file2eac5c0526dd' has size 0. Returning a NULL data.table.
发布评论
评论(1)
从评论转录:
偶尔(太多?)我发现从网络驱动器加载文件的问题(也许从r/python内部阅读)。在这种情况下,尝试从网络驱动器
s:
复制到本地 c:驱动器上的某个地方,然后从那里读取。在这种情况下,您的问题与data.table :: fread
或数据大小无关,只是一个小故障,可以访问网络上的大文件。Transcribed from comments:
Occasionally (too often?) I find problems loading files from network drives (perhaps more so reading from within R/python). In cases like this, try copying from the network drive
S:
to somewhere on your localC:
drive and read from there. In this case, your problem has nothing to do withdata.table::fread
or the data size, merely a glitch accessing that large a file on the network.