[R] a question about "latex" in Hmisc

Shi, Tao shidaxia at yahoo.com
Wed May 12 21:38:43 CEST 2010


Hi Erik,

Thanks for the quick reply!

My attachment was in .png which should be supported by the list ....  I'm resending it.

Yes, I knew by assigning it to an object, I can avoid this.  But, I'm curious to know what if I choose to do e.g. just latex(x), how can I get rid of the error window.  It actually worked for me once (i.e. I got Yap poped out to preview the table I'm generating), but I had no idea what I did differently.

...Tao




----- Original Message ----
> From: Erik Iverson <eriki at ccbr.umn.edu>
> To: "Shi, Tao" <shidaxia at yahoo.com>
> Cc: r-help at r-project.org
> Sent: Wed, May 12, 2010 12:27:32 PM
> Subject: Re: [R] a question about "latex" in Hmisc
> 
> 

Shi, Tao wrote:
> Hi list,
> 
> Excuse me b/c this is 
> probably a more "TeX" then "R" question.
> 
> I've been using 
> "latex" function in my .Rnw file to generate tables, but I've always been using 
> it without assigning the result to a object, i.e.
> 
> x <- 
> matrix(1:6, nrow=2, dimnames=list(c('a','b'),c('c','d','this that')))
> 
> latex(x)
> 
> so, I always get the error window (attached) poped 
> out.  But since I can just click OK and everything seems fine except in my 
> working directory I get a bunch of "junk" files (.log, .dvi, etc...), I've been 
> ignoring it.

Your attachment did not come through, most likely because it 
> is not a type that is supported by the list.

> 
> Now I know by 
> doing e.g. tmp <- latex(x) will suppress this error message, but I'm still 
> curious on how to get rid of the error window when I just use latex(x).   I 
> read the "Example" section of "latex" help file and I tried to include the 
> following into my PATH:
> 
> "C:\Program Files\MiKTeX 
> 2.7\tex\latex"

Well I can't directly help you with your issue, since I 
> don't know what error you're receiving, the reason this is happening is that 
> when you don't assign the result of your latex call, the function 'print.latex' 
> is getting called, which if I understand tries to compile the LaTeX output and 
> display the result in a suitable viewer.  By assigning the results of the 
> latex call in R, you stop this printing from happening.

As for what your 
> issue is, I don't know since your attachment did not come through.


      


More information about the R-help mailing list