[R] Hmisc latex function

Rick Bilonick rab45 at pitt.edu
Wed Oct 12 16:32:51 CEST 2005


Charles Dupont wrote:

> Marc Schwartz (via MN) wrote:
>
>> On Tue, 2005-10-11 at 10:01 -0400, Rick Bilonick wrote:
>>
>>> I'm using R 2.2.0 on an up-to-date version of Fedora Core 4 with the
>>> latest version of Hmisc. When I run an example from the latex 
>>> function I
>>> get the following:
>>>
>>>
>>>> x <- matrix(1:6, nrow=2, dimnames=list(c('a','b'),c('c','d','enLine
>>>
>>>
>>> 2')))
>>>
>>>> x
>>>
>>>
>>>  c d enLine 2
>>> a 1 3        5
>>> b 2 4        6
>>>
>>>> latex(x)   # creates x.tex in working directory
>>>
>>>
>>> sh: line 0: cd: â€œ/tmp/Rtmpl10983â€: No such file or directory
>>> This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
>>> entering extended mode
>>> ! I can't find file `â€œ/tmp/Rtmpl10983/file643c9869â€'.
>>> <*> â€œ/tmp/Rtmpl10983/file643c9869â€
>>>
>>> Please type another input file name: q
>>> (/usr/share/texmf/tex/latex/tools/q.tex
>>> LaTeX2e <2003/12/01>
>>> Babel <v3.8d> and hyphenation patterns for american, french, german,
>>> ngerman, b
>>> ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch,
>>> esperanto, e
>>> stonian, finnish, greek, icelandic, irish, italian, latin, magyar,
>>> norsk, polis
>>> h, portuges, romanian, russian, serbian, slovak, slovene, spanish,
>>> swedish, tur
>>> kish, ukrainian, nohyphenation, loaded.
>>> File ignored
>>> xdvi-motif.bin: Fatal error: /tmp/Rtmpl10983/file643c9869.dvi: No such
>>> file.
>>>
>>>
>>> How can I fix this?
>>>
>>> Rick B.
>>
>>
>>
>> I get the same results, also on FC4 with R 2.2.0.
>>
>> I am cc:ing Frank here for his input, but a quick review of the code and
>> created files suggests that there may be conflict between the locations
>> of some of the resultant files during the latex system call. Some files
>> appear in a temporary R directory, while others appear in the current R
>> working directory.
>>
>> For example, if I enter the full filename:
>>  
>>   /tmp/RtmpC12100/file643c9869.tex
>>
>> at the latex prompt, I get:
>>
>>
>>> latex(x)
>>
>>
>> sh: line 0: cd: â€œ/tmp/RtmpC12100â€: No such file or directory
>> This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
>> entering extended mode
>> ! I can't find file `â€œ/tmp/RtmpC12100/file643c9869â€'.
>> <*> â€œ/tmp/RtmpC12100/file643c9869â€
>>
>> Please type another input file name: *** loading the extensions
>> datasource
>> /tmp/RtmpC12100/file643c9869.tex
>> (/tmp/RtmpC12100/file643c9869.tex
>> LaTeX2e <2003/12/01>
>> Babel <v3.8d> and hyphenation patterns for american, french, german,
>> ngerman, b
>> ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch,
>> esperanto, e
>> stonian, finnish, greek, icelandic, irish, italian, latin, magyar,
>> norsk, polis
>> h, portuges, romanian, russian, serbian, slovak, slovene, spanish,
>> swedish, tur
>> kish, ukrainian, nohyphenation, loaded.
>> (/usr/share/texmf/tex/latex/base/report.cls
>> Document Class: report 2004/02/16 v1.4f Standard LaTeX document class
>> (/usr/share/texmf/tex/latex/base/size10.clo))
>> (/usr/share/texmf/tex/latex/geometry/geometry.sty
>> (/usr/share/texmf/tex/latex/graphics/keyval.sty)
>> (/usr/share/texmf/tex/latex/geometry/geometry.cfg))
>> No file file643c9869.aux.
>> [1] (./file643c9869.aux) )
>> Output written on file643c9869.dvi (1 page, 368 bytes).
>> Transcript written on file643c9869.log.
>> xdvi-motif.bin: Fatal error: /tmp/RtmpC12100/file643c9869.dvi
>
>
>
> Hmmmm,  It works for me.  Interesting.
>
> It almost looks like the temp dir is not being created, but thats not 
> possible because R does that.  It might be a Unicode issue with you 
> system shell.  Can you run this statement in R
>
> sys(paste('cd',dQuote(tempdir()),";",
> "echo Hello BOB > test.test",
> ";","cat test.test"))
>
>
> What version of Hmisc are you using?  What local are you using?
>
> Charles
>
I'm using Hmisc 3.0-7 (2005-09-15). I did an update.packages right after 
installing R 2.2.0. Here is the output I get:

sh: line 0: c: "/tmp/RtmpSp4207": No such file or directory
[1] "Hello BOB"

Thanks.

Rick B.




More information about the R-help mailing list