[R] Graphical table in R
Dan Bolser
dmb at mrc-dunn.cam.ac.uk
Tue Jan 11 15:59:12 CET 2005
On 10 Jan 2005, Peter Dalgaard wrote:
>Dan Bolser <dmb at mrc-dunn.cam.ac.uk> writes:
>
>> Cheers. This is really me just being lazy (as usual). The latex function
>> in Hmisc allows me to make a .ps file then grab a screen shot of that ps
>> and make a .png file.
>>
>> I would just like to use plot so I can wrap it in a png command and not
>> have to use the 'screen shot' in between.
>
>A screen shot of a ps file? That sounds ... weird. If you can view it,
>presumably you have Ghostscript and that can do png files.
The thing is the ps file has teh wrong size, so I end up with a small
table in the corner of a big white page (using imageMagick convert
function).
I havent tried ghostscript (don't know the cmd).
I could set the paper size correctly if I knew the size of my table, but I
don't know how to calculate that before hand and feed it into the latex
commands (Hmisc).
Seems like I should roll my own table with the plot command and
'primatives' (like the demo(mathplot)) - I just hoped that someone had
already done the hard work for me and I could type something like...
plot.xtable(x)
x = any R object that makes sense to have a tabular output.
Seems like such a function done correctly could be usefull for helping
people write up (hem) analysis.
Thanks again for the help everyone.
Dan.
>
>However, will textual output do?
>
> plot(0,type="n",axes=FALSE, xlab="", ylab="")
> con <- textConnection("txt","w")
> sink(con); ftable(UCBAdmissions); sink()
> close(con)
> par(family="mono")
> text(1,0,paste(txt,collapse="\n"))
>
>
>
More information about the R-help
mailing list