[R] Adding a table to a plot area
Frank E Harrell Jr
f.harrell at vanderbilt.edu
Sat Sep 22 17:38:33 CEST 2007
Charles Annis, P.E. wrote:
> Professor Harrell:
>
> I'm one of the slow kids and am having trouble following instructions, which
> state, in part:
>
> Download fragmaster.pl from
> http://www.tat.physik.uni-tuebingen.de/~vogel/fragmaster/main.html
> and save it in ~/bin and chmod a+x fragmaster.pl
>
> Finding fragmaster.pl was easy, as was saving it to ~/bin in my R2.5.0
> folder.
>
> A search for "chmod" returned only "chmod.al" in my folder
> C:\Program Files\Perl\lib\auto\POSIX
The how-to is only for Linux/Unix/Mac OSX. Someone will have to
translate for Windows. All of this should run fine in Windows if you
install Perl and LaTeX but there are issues with paths, etc.
Frank
>
>
>
> Not surprisingly running the script is unsuccessful:
>> library(Hmisc)
>> postscript('psfrag2_fm.eps', pointsize=12,
> + onefile=FALSE, paper='special',
> + horizontal=FALSE, height=4, width=5)
>> par(mar=c(3, 3.25, .25, .5), lwd=1.5, mgp = c(2, 0.45, 0), tcl = -0.4)
>>
>> x <- seq(0,15,length=100)
>> plot(x, dchisq(x, 5), ylab='fx', type='l') # fx will be substituted by
> $f(x)$
>> text(10, .13, 'ww', adj=0) # LaTeX table will be put at location of ww in
> graph
>> dev.off()
> null device
> 1
>> x <- cbind(Age=format(c(23.0,9.7)), Sex=c('Male','Female'))
>> tab <- latexTabular(x, align='rl') # new function in Hmisc
> Error: could not find function "latexTabular"
>> cat('\\psfrag{ww}{\\small', tab, '}',
> + '\\psfrag{fx}{$f(x)$}',
> + sep='\n', file='psfrag2_fm')
> Error in cat("\\psfrag{ww}{\\small", tab, "}", "\\psfrag{fx}{$f(x)$}", :
> object "tab" not found
>> system('fragmaster.pl psfrag2')
> Warning message:
> Impossible to run C:\PROGRA~1\R\R-25~1.0\bin\FRAGMA~1.PL psfrag2
>
>
> Please help me do whatever this means:
> " ... save it in ~/bin and chmod a+x fragmaster.pl"
> ^^^^^^^^^^^^^^^^^^^^^^^
>
> Thanks.
>
> Charles Annis, P.E.
>
> System Details:
> R2.5.0 running on a DELL 3GHz Pentium 4, 2 Gig RAM, WinXP service pack 2
>
>
>
> Charles.Annis at StatisticalEngineering.com
> phone: 561-352-9699
> eFax: 614-455-3265
> http://www.StatisticalEngineering.com
>
>
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
> Behalf Of Frank E Harrell Jr
> Sent: Friday, September 21, 2007 6:42 PM
> To: Judith Flores
> Cc: RHelp
> Subject: Re: [R] Adding a table to a plot area
>
> Judith Flores wrote:
>> Is there a command to insert a table into the plot
>> area other that using text?
>>
>> Thank you.
>
> To me the only completely satisfying approach is to use LaTeX and psfrag
> in you want great alignment and other features. A howto with R is at
> http://biostat.mc.vanderbilt.edu/PsFrag . This uses the fragmaster perl
> script which runs LaTeX from within R to make the final graphics file
> self-contained.
>
> Frank
>
More information about the R-help
mailing list