updated reproducible R codes

based on the revised manuscript