Re: [R] latex{Hmisc} cannot find xdvi on MAC OS X

From: Don MacQueen <>
Date: Thu, 24 Jan 2008 14:31:23 -0800

Nobody seems to have asked whether the student is using R from the Mac GUI, or R at the unix-style command line prompt.

I have R 2.6.1 installed on a Mac running OS 10.4.11. When I start R at the command prompt in a terminal emulator in the X windows environment, the example expression, latex(describe(dataframe)), succeeds. xdvi starts up and displays the preview.

When I use the Mac GUI, xdvi does not start up. Both ways of starting R are using the same installation of R.

When started by double-clicking on the icon that represents R, the unix path is not inherited. It's probably more accurate to say that PATH does not exist, because no unix shell has been started. There are other mechanisms for creating environment variables that R can obtain via Sys.getenv(). (Create a file named environment.plist, or something like that, but I don't remember the exact details.)

Even if the R gui environment is set up so that the path to xdvi is available, it won't necessarily work, because xdvi requires that an X windows server and window manager be running. That's not normally the case for most Mac users (one assumes). On Mac OS 10.5.x those should start automatically when xdvi is started, but not on earlier versions of Mac OS.

(As an aside, this is probably the answer to Frank's comment, "shame on Mac" (for not inheriting path) -- if one wants the Mac to act like a linux box, then one must do one's work from within a unix shell. That's done either from the Terminal application, or other terminal emulator.)

The experts on this issue are best reached through R-sig-mac. A search of the archives will probably reveal how to define unix stye environment variables such as PATH, that the Mac R gui can use. The Mac-related pages at CRAN may also have this information.


At 9:22 AM -0500 1/23/08, Kevin E. Thorpe wrote:
>I am posting this on behalf of a student in my class. I have been
>introducing them to R.
>I suspect that the problem I need help with is not so much an R
>issue, but a MAC config issue, but I don't have enough MAC
>experience to know what to do.
>Anyway, on to the problem. We are using Frank Harrell's Hmisc
>and Design packages. This student also wishes to use the latex
>formatting facilities provided in those packages so she has installed
>When she does something like latex(describe(dataframe)), the latex
>file is produced, the dvi file is successfully written but then
>the error "sh: line 1: xdvi: command not found" appears.
>I started a terminal and a "which xdvi" returned the path
>where it found xdvi. So, it appears that xdvi is in the
>My apologies, I forgot to get her sessionInfo() but I think
>she is running R 2.6.?
>Kevin E. Thorpe
>Biostatistician/Trialist, Knowledge Translation Program
>Assistant Professor, Department of Public Health Sciences
>Faculty of Medicine, University of Toronto
>email: Tel: 416.864.5776 Fax: 416.864.6057
> mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 24 Jan 2008 - 22:33:34 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 Thu 24 Jan 2008 - 23:30:08 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive