Relative Content

Tag Archive for rdataframe

Generating a text file with alternating rows from a data frame in R

I am looking to use R to generate a text file with one row that says “128, 128” and the next row is the 1st row from a data frame (with a comma between the two values). Then the third row is “128, 128” again, and the fourth row is the 2nd row from a data frame. The pattern continues for 1.7 million rows of the data frame.