subsetting R data frame
Only reason for such a long subset time is that you're running out of memory and the OS starts to swap. AFAIK base data.frame will create a copy of the data in memory before writing it to file.

What you can do is use either dplyr or data.table packages as they manage some of these steps without copying the data.