reformatted output of generate_folds in R wrapper