R now writes output into the data folder directly