How do I print every row in its own separate .pdf file in r?

185 Views Asked by At

I have tabulated data. I have to write some code to dynamically generate some .pdf reports. Once I know how to make R read and publish only 1 row at a time, I will be using Sweave to format it and make it look nice.

For example, if my data set looks like this:

Name | Sport | Country
Ronaldo | Football | Portugal
Federer | Tennis |Switzerland
Woods | Golf | USA

My output would be composed of three .pdf files. The first one would say "Ronaldo plays football for Portugal"; and so on for the other two rows.

I have started with a for-loop but every forum I have trawled through talks about the advantages of the -apply functions over it but I don't know how to make it apply on every row of the data.

PS: This is my first post on stackoverflow.com. Excuse me if I am not following the community rules here. I will try my best to ensure that the question conforms to the guidelines based on your feedback.

0

There are 0 best solutions below