I am trying to read in certain columns from a 2.5 gb .csv file into Rstudio using the data.table
package and fread
function. I am selecting the columns I need using the select
function because without doing so I get an error message that says Error: cannot allocate vector of size 105.7 Mb
. My input commands look like:
library(data.table)
setwd(<set local working directory>)
dat <- fread("File.csv", select = c(1,3,5:6,9:10,13:14,19:20))
When I run this code I get the following warning message telling me that fread
stopped early In fread("File.csv", select = c(1, 3, 5:6, 9:10, 13:14, 19:20)) : Stopped early on line 8691
.
Is there a way to force fread
to not stop early and to read in all rows for the selected columns?