Farrel Buchinsky
2009-Apr-16 18:23 UTC
[R] Printing data as a narrative or form letter rather than as a table
How would one print the information in a table without having to view it as a table? I have a dataframe with about 30 columns and 50 rows. About 7 rows contain human subjects where something is just not right and I need to manually work out what is going on with them and maybe even call them to ensure we have the data correct. It is really inconvenient to view the 7 patients in a table. Instead, I would want to print the information so that it looks like this. I guess what I am asking is how does one use print() or cat() to create a form letter. data frame column names are dob, date.of.dx, registration.nr, first.name, last.name, human.contact, comment... Human subject 1 dob=5/5/2003, date.of.dx=5/8/2003, registration.nr=568956TJGH, first.name=Farrel, last.name=Buchinsky, human.contact=yes, comment=Spoke with human subject on Tuesday December 27, 2008. They asked questions about the study and wanted to enroll. I told them I would get back to them within a week, date.enrolled=01/05/2009, wt=20 ... Human Subject 2 dob=5/8/2006, date.of.dx=7/72007, registration.nr=579293TGGG, first.name=Marmeduk, last.name=Marmite, human.contact=yes, comment=parent bumped into me at meeting and had lots of questions, we spoke for 2 hours, they lived in Norway until 2 years ago, date.enrolled=01/23/2009, wt=10 ... (by the way...all fictitious) Farrel Buchinsky Sent from Pittsburgh, Pennsylvania, United States [[alternative HTML version deleted]]