I am downloading a 120mb csv file from webserver using read.csv(textConnection(binarydata1))
and this is painfully slow. I tried pipe()
, like this read.csv(pipe(binarydata1))
I am getting an error Error in pipe(binarydata1) : invalid 'description' argument
. Any help regarding this issue is much appricated.
@jeremycg, @hrbrmstr
Suggestion
fread from the data.table package.
local storage via download.file or functions in curl or httr and use data.table::fread like @jeremycg suggested or readr::read_csv
Response
The csv file i am dealing with is in binary format, so I am converting this to standard format using these functions
t1 = getURLContent(url,userpwd,httpauth = 1L, binary=TRUE)
t2 = readBin(t1, what='character', n=length(t1)/4)
when I try fread(t2)
after converting binary to standard format i get an error
Error in fread(t61) :
'input' must be a single character string containing a
file name, a command, full path to a file, a URL starting
'http://' or 'file://', or the input data itself
If i try fread directly without converting binary to standard format then no problem it works, if I try converting binary to standard format it does not work