Publication Quality Table in R
1
0
Entering edit mode
David Lyon ▴ 340
@david-lyon-4016
Last seen 2.4 years ago
United States
How do I generate a simple table similar to the following link in R http://www.fedstats.gov/policy/publications/wp1fig1_text.html Table 1 Poverty status, by age, 2000 Does anyone know the exact commands? Apologizies for the newbie question . Thanks
• 2.5k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 12 weeks ago
United States
On Mon, Jun 7, 2010 at 12:50 PM, David Lyon <david_lyon3@yahoo.com> wrote: > > How do I generate a simple table similar to the following link in R > > http://www.fedstats.gov/policy/publications/wp1fig1_text.html > Table 1 Poverty status, by age, 2000 > > Does anyone know the exact commands? Apologizies for the newbie question . > See the xtable package, for instance? Sean [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
Thanks for the pointer Sean Looks like xtable is the way to go but from reading the documentation and the articles online it doesnt provide a clear example in my eyes how would one convert from an input file like below into a table figure(jpeg or png) for publication. Thanks again for everyones help.\ Input File: tab separated: Age poor near poor 65-69 8 4 70-74 10 6 75-79 11 7 80-84 12 8 >85 14 12 ________________________________ From: Sean Davis <sdavis2@mail.nih.gov> Cc: bioconductor@stat.math.ethz.ch Sent: Mon, June 7, 2010 1:01:27 PM Subject: Re: [BioC] Publication Quality Table in R >>How do I generate a simple table similar to the following link in R > >http://www.fedstats.gov/policy/publications/wp1fig1_text.html >>Table 1 Poverty status, by age, 2000 > >>Does anyone know the exact commands? Apologizies for the newbie question . > See the xtable package, for instance? Sean [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
On Mon, Jun 7, 2010 at 1:56 PM, David Lyon <david_lyon3@yahoo.com> wrote: > Thanks for the pointer Sean > > Looks like xtable is the way to go but from reading the documentation and > the articles online it doesnt provide a clear example in my eyes how would > one convert from an input file like below into a table figure(jpeg or png) > for publication. > > Thanks again for everyones help.\ > > > Hi, David. Sounds like you will need to read a little on R usage. A great starting place is here: http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual > > > Input File: tab separated: > Age poor near poor > 65-69 8 4 > 70-74 10 6 > 75-79 11 7 > 80-84 12 8 > >85 14 12 > > > See the help for read.table. If this is a one-off thing, loading into excel and exporting as html might also work. Sean > ________________________________ > From: Sean Davis <sdavis2@mail.nih.gov> > > Cc: bioconductor@stat.math.ethz.ch > Sent: Mon, June 7, 2010 1:01:27 PM > Subject: Re: [BioC] Publication Quality Table in R > > > > > > > > >>How do I generate a simple table similar to the following link in R > > > >http://www.fedstats.gov/policy/publications/wp1fig1_text.html > >>Table 1 Poverty status, by age, 2000 > > > >>Does anyone know the exact commands? Apologizies for the newbie question > . > > > > See the xtable package, for instance? > > Sean > > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
OK I got it to output latex using the package xtable but how do we print out to jpeg or png? Thanks again "my_frame <- read.table(file="table", header=TRUE, sep="\t"); print(design.table, type="latex")" '% latex table generated in R 2.11.0 by xtable 1.5-6 package % Mon Jun 7 16:03:59 2010 \begin{table}[ht] \begin{center} \begin{tabular}{rlrr} \hline & Age & poor & near.poor \\ \hline 1 & 65-69 & 8 & 4 \\ 2 & 70-74 & 10 & 6 \\ 3 & 75-79 & 11 & 7 \\ 4 & 80-84 & 12 & 8 \\ 5 & $>$85 & 14 & 12 \\ \hline \end{tabular} \end{center} \end{table} ________________________________ From: Sean Davis <sdavis2@mail.nih.gov> Cc: bioconductor@stat.math.ethz.ch Sent: Mon, June 7, 2010 2:08:57 PM Subject: Re: [BioC] Publication Quality Table in R >Thanks for the pointer Sean > >>Looks like xtable is the way to go but from reading the documentation and the articles online it doesnt provide a clear example in my eyes how would one convert from an input file like below into a table figure(jpeg or png) for publication. > >>Thanks again for everyones help.\ > > > Hi, David. Sounds like you will need to read a little on R usage. A great starting place is here: http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual > >>Input File: tab separated: >>Age poor near poor >>65-69 8 4 >>70-74 10 6 >>75-79 11 7 >>80-84 12 8 >>>85 14 12 > > > See the help for read.table. If this is a one-off thing, loading into excel and exporting as html might also work. Sean > >________________________________ >>From: Sean Davis <sdavis2@mail.nih.gov> > >>Cc: bioconductor@stat.math.ethz.ch >>Sent: Mon, June 7, 2010 1:01:27 PM >>Subject: Re: [BioC] Publication Quality Table in R > > > > > > > > >>>>How do I generate a simple table similar to the following link in R >>> >>>http://www.fedstats.gov/policy/publications/wp1fig1_text.html >>>>Table 1 Poverty status, by age, 2000 >>> >>>>Does anyone know the exact commands? Apologizies for the newbie question . >>> > >>See the xtable package, for instance? > >>Sean > > > > [[alternative HTML version deleted]] > >>_______________________________________________ >>Bioconductor mailing list >Bioconductor@stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor >>Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
These questions have nothing to do with Bioconductor. You should use R-help. For this task you could compile latex to dvi or pdf, then use imagemagick to convert pdf to your desired graphics format. You'd have to put a proper latex header/closer on this text and there are plenty of tutorials on that on the web. That's it, it is IMHO an abuse of this mailing list to pose these questions here. On Mon, Jun 7, 2010 at 3:09 PM, David Lyon <david_lyon3@yahoo.com> wrote: > OK I got it to output latex using the package xtable but how do we print > out to jpeg or png? > > Thanks again > > > "my_frame <- read.table(file="table", header=TRUE, sep="\t"); > print(design.table, type="latex")" > > '% latex table generated in R 2.11.0 by xtable 1.5-6 package > % Mon Jun 7 16:03:59 2010 > \begin{table}[ht] > \begin{center} > \begin{tabular}{rlrr} > \hline > & Age & poor & near.poor \\ > \hline > 1 & 65-69 & 8 & 4 \\ > 2 & 70-74 & 10 & 6 \\ > 3 & 75-79 & 11 & 7 \\ > 4 & 80-84 & 12 & 8 \\ > 5 & $>$85 & 14 & 12 \\ > \hline > \end{tabular} > \end{center} > \end{table} > > > > > > ________________________________ > From: Sean Davis <sdavis2@mail.nih.gov> > > Cc: bioconductor@stat.math.ethz.ch > Sent: Mon, June 7, 2010 2:08:57 PM > Subject: Re: [BioC] Publication Quality Table in R > > > > > > > >Thanks for the pointer Sean > > > >>Looks like xtable is the way to go but from reading the documentation and > the articles online it doesnt provide a clear example in my eyes how would > one convert from an input file like below into a table figure(jpeg or png) > for publication. > > > >>Thanks again for everyones help.\ > > > > > > > > Hi, David. Sounds like you will need to read a little on R usage. A great > starting place is here: > > http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual > > > > > >>Input File: tab separated: > >>Age poor near poor > >>65-69 8 4 > >>70-74 10 6 > >>75-79 11 7 > >>80-84 12 8 > >>>85 14 12 > > > > > > > > See the help for read.table. If this is a one-off thing, loading into > excel and exporting as html might also work. > > Sean > > > > > >________________________________ > >>From: Sean Davis <sdavis2@mail.nih.gov> > > > >>Cc: bioconductor@stat.math.ethz.ch > >>Sent: Mon, June 7, 2010 1:01:27 PM > >>Subject: Re: [BioC] Publication Quality Table in R > > > > > > > > > > > > > > > > > >>>>How do I generate a simple table similar to the following link in R > >>> > >>>http://www.fedstats.gov/policy/publications/wp1fig1_text.html > >>>>Table 1 Poverty status, by age, 2000 > >>> > >>>>Does anyone know the exact commands? Apologizies for the newbie > question . > >>> > > > >>See the xtable package, for instance? > > > >>Sean > > > > > > > > > [[alternative HTML version deleted]] > > > >>_______________________________________________ > >>Bioconductor mailing list > >Bioconductor@stat.math.ethz.ch > >https://stat.ethz.ch/mailman/listinfo/bioconductor > >>Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
On Mon, Jun 7, 2010 at 3:09 PM, David Lyon <david_lyon3@yahoo.com> wrote: > OK I got it to output latex using the package xtable but how do we print > out to jpeg or png? > This is really beyond the scope of R/Bioconductor. If you are not familiar with latex or html, it will be difficult to use xtable, for example. I would suggest using excel for this task and read up on these other topics at your leisure. Sean Thanks again > > > "my_frame <- read.table(file="table", header=TRUE, sep="\t"); > print(design.table, type="latex")" > > '% latex table generated in R 2.11.0 by xtable 1.5-6 package > % Mon Jun 7 16:03:59 2010 > \begin{table}[ht] > \begin{center} > \begin{tabular}{rlrr} > \hline > & Age & poor & near.poor \\ > \hline > 1 & 65-69 & 8 & 4 \\ > 2 & 70-74 & 10 & 6 \\ > 3 & 75-79 & 11 & 7 \\ > 4 & 80-84 & 12 & 8 \\ > 5 & $>$85 & 14 & 12 \\ > \hline > \end{tabular} > \end{center} > \end{table} > > > > > > ________________________________ > From: Sean Davis <sdavis2@mail.nih.gov> > > Cc: bioconductor@stat.math.ethz.ch > Sent: Mon, June 7, 2010 2:08:57 PM > Subject: Re: [BioC] Publication Quality Table in R > > > > > > > >Thanks for the pointer Sean > > > >>Looks like xtable is the way to go but from reading the documentation and > the articles online it doesnt provide a clear example in my eyes how would > one convert from an input file like below into a table figure(jpeg or png) > for publication. > > > >>Thanks again for everyones help.\ > > > > > > > > Hi, David. Sounds like you will need to read a little on R usage. A great > starting place is here: > > http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual > > > > > >>Input File: tab separated: > >>Age poor near poor > >>65-69 8 4 > >>70-74 10 6 > >>75-79 11 7 > >>80-84 12 8 > >>>85 14 12 > > > > > > > > See the help for read.table. If this is a one-off thing, loading into > excel and exporting as html might also work. > > Sean > > > > > >________________________________ > >>From: Sean Davis <sdavis2@mail.nih.gov> > > > >>Cc: bioconductor@stat.math.ethz.ch > >>Sent: Mon, June 7, 2010 1:01:27 PM > >>Subject: Re: [BioC] Publication Quality Table in R > > > > > > > > > > > > > > > > > >>>>How do I generate a simple table similar to the following link in R > >>> > >>>http://www.fedstats.gov/policy/publications/wp1fig1_text.html > >>>>Table 1 Poverty status, by age, 2000 > >>> > >>>>Does anyone know the exact commands? Apologizies for the newbie > question . > >>> > > > >>See the xtable package, for instance? > > > >>Sean > > > > > > > > > [[alternative HTML version deleted]] > > > >>_______________________________________________ > >>Bioconductor mailing list > >Bioconductor@stat.math.ethz.ch > >https://stat.ethz.ch/mailman/listinfo/bioconductor > >>Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
One possibility is to use xtable to write the results out to an HTML file and then manually import that HTML file into (gasp) Microsoft Word.... (or OpenOffice if you want to avoid the evil empire) Sean Davis wrote: > On Mon, Jun 7, 2010 at 3:09 PM, David Lyon <david_lyon3 at="" yahoo.com=""> wrote: > > >> OK I got it to output latex using the package xtable but how do we print >> out to jpeg or png? >> >> > > This is really beyond the scope of R/Bioconductor. If you are not familiar > with latex or html, it will be difficult to use xtable, for example. I > would suggest using excel for this task and read up on these other topics at > your leisure. > > Sean > > Thanks again > >> "my_frame <- read.table(file="table", header=TRUE, sep="\t"); >> print(design.table, type="latex")" >> >> '% latex table generated in R 2.11.0 by xtable 1.5-6 package >> % Mon Jun 7 16:03:59 2010 >> \begin{table}[ht] >> \begin{center} >> \begin{tabular}{rlrr} >> \hline >> & Age & poor & near.poor \\ >> \hline >> 1 & 65-69 & 8 & 4 \\ >> 2 & 70-74 & 10 & 6 \\ >> 3 & 75-79 & 11 & 7 \\ >> 4 & 80-84 & 12 & 8 \\ >> 5 & $>$85 & 14 & 12 \\ >> \hline >> \end{tabular} >> \end{center} >> \end{table} >> >> >> >> >> >> ________________________________ >> From: Sean Davis <sdavis2 at="" mail.nih.gov=""> >> >> Cc: bioconductor at stat.math.ethz.ch >> Sent: Mon, June 7, 2010 2:08:57 PM >> Subject: Re: [BioC] Publication Quality Table in R >> >> >> >> >> >> >> >>> Thanks for the pointer Sean >>> >>> >>>> Looks like xtable is the way to go but from reading the documentation and >>>> >> the articles online it doesnt provide a clear example in my eyes how would >> one convert from an input file like below into a table figure(jpeg or png) >> for publication. >> >>>> Thanks again for everyones help.\ >>>> >>> >>> >> Hi, David. Sounds like you will need to read a little on R usage. A great >> starting place is here: >> >> http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual >> >> >> >>>> Input File: tab separated: >>>> Age poor near poor >>>> 65-69 8 4 >>>> 70-74 10 6 >>>> 75-79 11 7 >>>> 80-84 12 8 >>>> >>>>> 85 14 12 >>>>> >>> >>> >> See the help for read.table. If this is a one-off thing, loading into >> excel and exporting as html might also work. >> >> Sean >> >> >> >>> ________________________________ >>> >>>> From: Sean Davis <sdavis2 at="" mail.nih.gov=""> >>>> >>>> Cc: bioconductor at stat.math.ethz.ch >>>> Sent: Mon, June 7, 2010 1:01:27 PM >>>> Subject: Re: [BioC] Publication Quality Table in R >>>> >>> >>> >>> >>> >>> >>> >>> >>>>>> How do I generate a simple table similar to the following link in R >>>>>> >>>>> http://www.fedstats.gov/policy/publications/wp1fig1_text.html >>>>> >>>>>> Table 1 Poverty status, by age, 2000 >>>>>> >>>>>> Does anyone know the exact commands? Apologizies for the newbie >>>>>> >> question . >> >>>> See the xtable package, for instance? >>>> >>>> Sean >>>> >>> >>> >>> >> [[alternative HTML version deleted]] >> >>>> _______________________________________________ >>>> Bioconductor mailing list >>>> >>> Bioconductor at stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> >>>> Search the archives: >>>> >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD REPLY

Login before adding your answer.

Traffic: 674 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6