I would like to add 4 extra rows of NA after each row of data in a csv file.
I tried the following but it only adds 4 extra rows at the end of the csv file instead of after each row.
addrowdata<-read.csv('test.csv')
addrowdata[nrow(addrowdata)+4,] <- NA
This seems like something that should be quite easy to do but I am struggling. Does anyone have any ideas?
This is my first time posting, so I hope this is ok and sorry for any mistakes. I searched for this but couldn't find an answer.