Code for writing data.frames to file and reading back in