Writes tidy data to a csv file