R: Read head/tail of large files