Re: [R] Hmisc latex() does not want to work

From: Richard M. Heiberger <rmh_at_temple.edu>
Date: Sun, 13 Jan 2008 20:12:40 -0500

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of John Kane
Sent: Sunday, January 13, 2008 03:56 PM

## Not run:
latex(x) # creates x.tex in working directory w <- latex(x, file='/tmp/my.tex')


I think there is an unclarity in the documentation. The documentation is correct and everything that Frank and Gabor wrote is also correct. The issue is side-effects, which I think need a bit more explanation. I would revise the first example above to read:

latex(x)   ## 1. creates x.tex in working directory and 

##
## 2. The result of the command is an object of class "latex"
## which is automatically printed by the latex print method.
## The latex print method prepends and appends latex headers
and
## calls the latex program in the PATH. If the latex program
is
## not in the PATH, you will get error messages from the
operating
## system.

Since you didn't have latex in the PATH, you got an error from the print method. The x.tex file was probably correctly generated and might still be sitting
in your default getwd() directory.

The second example,
w <- latex(x, file='/tmp/my.tex')
doesn't give an error message because the result of the latex() command is saved in the object w and not automatically printed.

Rich



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 14 Jan 2008 - 01:16:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 Jan 2008 - 15:30:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive