Skip to content

problem checking packages with R 2.13.0

12 messages · Kasper Daniel Hansen, John Fox, Brian Ripley

#
Dear list members,

I'm experiencing a problem checking packages with R 2.13.0 on a new Mac OS X 10.6.7 system. As far as I can tell, R isn't finding my LaTeX installation. Packages seem to build fine. Some details follow:

Here's what happens when I try to check a package:

----- snip ------

John-Foxs-MacBook-Pro:workspace jfox$ R CMD check car
* using log directory ?/Users/jfox/Documents/workspace/car.Rcheck?
* using R version 2.13.0 (2011-04-13)
* using platform: x86_64-apple-darwin9.8.0 (64-bit)
* using session charset: UTF-8
* checking for file ?car/DESCRIPTION? ... OK
* this is package ?car? version ?2.0-10?
. . .
* checking examples ... OK
* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
!pdfTeX error: pdflatex (file 8r.enc): cannot open encoding file for reading
 ==> Fatal error occurred, no output PDF file produced!
* checking PDF version of manual without hyperrefs or index ... ERROR

----- snip ------

I get the following error when I try to check the package under eclipse/StatET (deleting the lines before the error):


----- snip ------

* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
* checking PDF version of manual without hyperrefs or index ... ERROR
Re-running with no redirection of stdout/stderr.
Hmm ... looks like a package
You may want to clean up by 'rm -rf /var/folders/ay/ayD+f6yQFomFC5SGQV6vP++++TI/-Tmp-//RtmpopONVs/Rd2pdf16f793c'
Error in texi2dvi("Rd2.tex", pdf = (out_ext == "pdf"), quiet = FALSE,  : 
  pdflatex is not available
Error in running tools::texi2dvi


----- snip ------

But I have no problem running pdflatex from a terminal window:


----- snip ------

John-Foxs-MacBook-Pro:~ jfox$ pdflatex --help
Usage: pdftex [OPTION]... [TEXNAME[.tex]] [COMMANDS]
   or: pdftex [OPTION]... \FIRST-LINE

----- snip -----------

Nor does Sys.which() seem to find pdflatex:

----- snip ------

R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-apple-darwin9.8.0/i386 (32-bit)

. . .

[R.app GUI 1.40 (5751) i386-apple-darwin9.8.0]

[History restored from /Users/jfox/.Rapp.history]
pdflatex 
      "" 

----- snip ------

Some more information about my system:

----- snip ------
sysname 
                                                                                         "Darwin" 
                                                                                          release 
                                                                                         "10.7.3" 
                                                                                          version 
"Darwin Kernel Version 10.7.3: Sun Mar  6 13:37:56 PST 2011; root:xnu-1504.14.2~1/RELEASE_X86_64" 
                                                                                         nodename 
                                                                    "John-Foxs-MacBook-Pro.local" 
                                                                                          machine 
                                                                                         "x86_64" 
                                                                                            login 
                                                                                           "jfox" 
                                                                                             user 
                                                                                           "jfox"
R version 2.13.0 (2011-04-13)
Platform: i386-apple-darwin9.8.0/i386 (32-bit)

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/C/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

----- snip ------

Any suggestions would be appreciated.

Thanks,
 John

------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/
#
On Sat, 16 Apr 2011, John Fox wrote:

            
Assuming this is the CRAN build of R, it is looking on the path.  So 
all I can think is that you have the path set incorrectly somewhere in 
your R statrtup files.

  
    
#
Dear Brian and others,

Yes, I installed the CRAN build of R, and yes, something is changing the
path in R.app, and in eclipse, but not apparently when R is run in a
terminal window.
------------- snip --------------

John-Foxs-MacBook-Pro:Rmpi jfox$ R

R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing ISBN
3-900051-07-0
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

. . .
[1] "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin"

------------- snip --------------

In R.app (and in R64.app):

------------- snip --------------

R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing ISBN
3-900051-07-0
Platform: i386-apple-darwin9.8.0/i386 (32-bit)

. . .

[R.app GUI 1.40 (5751) i386-apple-darwin9.8.0]

[History restored from /Users/jfox/.Rapp.history]
[1] "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"

------------- snip --------------

And in eclipse:

------------- snip --------------

R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing ISBN
3-900051-07-0
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

. . .
[1]
"/Library/Frameworks/R.framework/Versions/2.13/Resources/bin:/usr/bin:/bin:/
usr/sbin:/sbin"

------------- snip --------------

I've had no luck, however, figuring out what's changing the path: As far as
I can tell, I have no Rprofile.site file, no .Rprofile file, and the
R_PROFILE and R_PROFILE_USER environment variables are unset. In fact the
only R initialization files that I could find anywhere on my system are the
Rprofile files in the base and Rmpi packages; as far as I can see, the
former can't shorten the path and I'm not using the latter.

Finally, looking more closely at the errors I'm getting when I try to check
a package, the errors in a terminal window and from eclipse look different:
the error message:

------------- snip --------------

* checking PDF version of manual ... WARNING LaTeX errors when
creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
!pdfTeX error: pdflatex (file 8r.enc): cannot open encoding file for
reading ==> Fatal error occurred, no output PDF file produced!
* checking PDF version of manual without hyperrefs or index ... ERROR

------------- snip --------------
------------- snip --------------

* checking PDF version of manual ... WARNING LaTeX errors when
creating PDF version.
This typically indicates Rd problems.
* checking PDF version of manual without hyperrefs or index ... ERROR
Re-running with no redirection of stdout/stderr.
Hmm ... looks like a package
You may want to clean up by 'rm -rf
/var/folders/ay/ayD+f6yQFomFC5SGQV6vP++++TI/-Tmp-
//RtmpopONVs/Rd2pdf16f793c'
Error in texi2dvi("Rd2.tex", pdf = (out_ext == "pdf"), quiet = FALSE,  :
pdflatex is not available
Error in running tools::texi2dvi

------------- snip --------------

So there are possibly two independent problems here.

I'm not sure where to look next, so again any help would be appreciated.

Best,
 John
#
John,

I don't know about Eclipse, but on a Mac it is completely standard
that a GUI does not inherit anything from .bashrc/.profile.  So it is
pretty standard that you may have problems with environment variables.
 You can do two things
  (1) use environment.plist (google it)
  (2) use Sys.setenv() inside your .Rprofile

Now, regarding latex, the standard on Mac would be to run MacTex.  I
am unaware of how R.app deals with MacTex but I would be ready to
guess that the PATH might be semi-build in (I am sure some of the
R.app people will correct me on this).  So you might want to add info
about what tex distribution you are using.

Kasper
On Sun, Apr 17, 2011 at 4:21 PM, John Fox <jfox at mcmaster.ca> wrote:
#
Dear Kaspar,
That helps a bit. That is, I didn't previously have a .Rprofile file, so I
put one in my home directory, setting the PATH to
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin. Now
both R CMD check in a terminal window and checking inside eclipse fail with
the same error, "!pdfTeX error: pdflatex (file 8r.enc): cannot open encoding
file (etc.)", rather than with different errors. So, at this point, I don't
think that finding pdflatex is the issue.
Good point. I used the MacTeX-2010 distribution, which I got to from item
2.1 in the R for Mac OS X FAQ.

Thanks for trying to help.

John
#
On Sun, Apr 17, 2011 at 7:16 PM, John Fox <jfox at mcmaster.ca> wrote:
Since this is a new Mac, what file system are you using?  I have no
idea on how to troubleshoot your error, but I guess that info about
the file system might help more knowledgeable people.

Or could this be e problem with the encoding of (one of) the help
files in the package?

Kasper
#
Dear Kasper,
. . .
I'm afraid I don't know how to answer: I didn't make any changes to the file
system that came with the machine. Don't Macs use the HFS+ file system?
I don't think so: The car package checks on my Windows 7 system, on an older
Mac, and on R-Forge.

Thanks again for trying to help.

John
#
John,

Having resolved the path issues, I think you do have a problem with 
your latex installation.  Try (in the terminal)

tystie% kpsewhich 8r.enc
/usr/local/texlive/2010/texmf-dist/fonts/enc/dvips/base/8r.enc

If that comes back empty, try (possibly with sudo) tystie% texhash to 
rebuild the indices.  If that doesn't work, you need to work out how 
you have an incomplete installation, something I've never seen with 
Mactex.

(FWIW 8r.enc is what tells latex how to encode output for Type 1 
fonts: it is nothing to do with the encoding of the latex inputs.)

Brian
On Sun, 17 Apr 2011, John Fox wrote:

            
By defualt .....

  
    
#
Dear Brian,

Thank you very much for this. I'm in my office today without my MacBook but will give this a try tonight.

Best,
 John

On Mon, 18 Apr 2011 14:34:31 +0100 (BST)
Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/
#
Dear Brian,

On Mon, 18 Apr 2011 14:34:31 +0100 (BST)
Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
That is indeed empty.
(I'm just lucky, I guess.) I tried this and it didn't fix the problem. 

I then reinstalled MacTeX-2010, taking all of the defaults in the installer, as I did before, and that fixed the problem. Obviously, my original TeX installation was broken.

I don't think that I should have to set the PATH explicitly in my .Rprofile when I use eclipse (I've never had to before, on any platform), but that works too. I'll investigate further and maybe send a message to the StatET list.

Thank you for all of your help -- I really appreciate it. 

John
#
On Mon, Apr 18, 2011 at 9:49 PM, John Fox <jfox at mcmaster.ca> wrote:
I don't set my PATH either, but it is useful for various purposes.  If
you use the CRAN binary of R, my guess would be that most programs
"know" where to look.  But that does depend on the program you use.

Kasper
#
Dear Kasper,

On Mon, 18 Apr 2011 22:32:35 -0400
Kasper Daniel Hansen <kasperdanielhansen at gmail.com> wrote:
Remember that the problem was that eclipse wasn't finding pdflatex when I checked R packages; eclipse had no problem finding R since defining an R environment in eclipse involves pointing to R_HOME. Anyway, as I mentioned in my previous email, Brian's suggestions led me to a solution.

Best,
 John
------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/