R write to csv file
R change of loop
R change in loop
added picture and small edits