0

I've got a csv file which is 65000 rows from 2005 to 2016, so I just need to read a few thousand from the endrows. This is how I'm reading the file so far:

header <- c("Date", "Time", "Open", "High", "Low", "Close", "Volume")

#Data Frame of hourly data for GBPUSD
dfGBPUSD60 <- read.csv("03GBPUSD60.csv", header = header, sep = ",", quote =     
"\"")

in R this takes ages to read. Is there an efficient way of reading just the last rows from this file?

  • 2
    Possible duplicate of [How to import last 100 rows using read.csv() in R](http://stackoverflow.com/questions/18526267/how-to-import-last-100-rows-using-read-csv-in-r) – Michael Veale Apr 13 '16 at 21:54
  • See `?read.csv`; it has a `skip` parameter. Also, `header` is Boolean and `","` is the default for `sep`. – alistaire Apr 13 '16 at 22:21
  • you should have no problem reading in a 65k x 7 csv file into r with `read.csv` instantly – rawr Apr 13 '16 at 22:51
  • and `header` should be a logical – rawr Apr 13 '16 at 22:59

0 Answers0