Re: [R] dvips function gives Documents not found error

2003-11-28 Thread Prof Brian Ripley
On Thu, 27 Nov 2003, Dirk Eddelbuettel wrote:

 On Thu, Nov 27, 2003 at 04:21:04PM -0800, David Kelly wrote:
  Frank Harrell wrote:
  
   Did you make the changes I suggested (surrounding two items by
   dQuote())?
  
   Have you tried Linux?
  
  No, I didn't make those changes because I've just been working with a 
  binary distribution. I may go ahead and pull down sources and try; I was 
 
 But that's the beauty of it -- even in Windoze, the $R_HOME/library/$FOO/R/
 directory for a package $FOO contains simple text code which you can edit.
 
 If you know how to read and write S source code, I may take you only about
 one minute to locate the file, and insert the suggested dQuote().
 
  trying to avoid that.
  
  I wish I were working with Linux, but I'm doing this work for someone 
  with many installed PCs that want to use R, and they're all running 
  Win2K and that isn't going to change.
 
 If you organise your work environment wel, operating systems matter less and
 less. R, Perl, Python, ... are pretty much completely cross-platform (unless
 you insist on using OS-specific features). 

Well, it is sort of the latter.  Almost all current OSes allow spaces in 
paths, but only Windows users seem to make use of them.  Which is why 
early on I suggested that it would be good if Frank could ensure they are 
allowed in Hmisc.   However (and I don't know if this is the issue here)
there is the concept of `quoting hell' and quoting is certainly not even
cross-sh-clones on Unix-alike.  And since Dirk mentions Perl, the system() 
call in Perl does not even work the same on Windows 98 and 2000/XP, 
something R has always managed.

I will try over the weekend to track down exactly where the problem lies,
but only because it may help us to be offer some general guidelines.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] dvips function gives Documents not found error

2003-11-27 Thread David Kelly
This is primarily an FYI to the Hmisc author, though any brilliant 
suggestions from him or anyone else are always welcome.  Re this problem 
reported earlier in this thread:

  getting an error from Hmisc when trying
  dvips(latex(describe(mtcars)),file=/kellytest/kelly.ps)
  that says
  Error in system(cmd, intern = intern, wait = wait | intern,
  show.output.on.console = wait,  :
C:/Documents not found
  which appears to be a path-parsing problem of Documents and Settings
The problem is still present. I've tried every suggestion that was sent 
to me. Most recently, I created a .Renviron which said
TMP=c:/kellytest/rtemp
and I then ran R (from within emacs/ess).

I verified that TMP had been set correctly as follows:
 tempdir()
[1] c:/kellytest/rtemp\\Rtmp5417
but I still got the C:/Documents not found error.

P.S. I found that a TeX file was created when the command was executed, 
but I could find no evidence of a dvi or ps file.

-- David Kelly

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] dvips function gives Documents not found error

2003-11-27 Thread Frank E Harrell Jr
On Thu, 27 Nov 2003 10:04:51 -0800
David Kelly [EMAIL PROTECTED] wrote:

 This is primarily an FYI to the Hmisc author, though any brilliant 
 suggestions from him or anyone else are always welcome.  Re this problem
 
 reported earlier in this thread:
 
getting an error from Hmisc when trying
dvips(latex(describe(mtcars)),file=/kellytest/kelly.ps)
that says
Error in system(cmd, intern = intern, wait = wait | intern,
show.output.on.console = wait,  :
   C:/Documents not found
which appears to be a path-parsing problem of Documents and
Settings
 
 The problem is still present. I've tried every suggestion that was sent 
 to me. Most recently, I created a .Renviron which said
 TMP=c:/kellytest/rtemp
 and I then ran R (from within emacs/ess).
 
 I verified that TMP had been set correctly as follows:
   tempdir()
 [1] c:/kellytest/rtemp\\Rtmp5417
 
 but I still got the C:/Documents not found error.
 
 P.S. I found that a TeX file was created when the command was executed, 
 but I could find no evidence of a dvi or ps file.
 
 -- David Kelly
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Did you make the changes I suggested (surrounding two items by dQuote( ))?

Have you tried Linux?  :)

---
Frank E Harrell JrProfessor and ChairSchool of Medicine
  Department of BiostatisticsVanderbilt University

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] dvips function gives Documents not found error

2003-11-27 Thread David Kelly
Frank Harrell wrote:

 Did you make the changes I suggested (surrounding two items by
 dQuote())?

 Have you tried Linux?

No, I didn't make those changes because I've just been working with a 
binary distribution. I may go ahead and pull down sources and try; I was 
trying to avoid that.

I wish I were working with Linux, but I'm doing this work for someone 
with many installed PCs that want to use R, and they're all running 
Win2K and that isn't going to change.

Thanks for the reply -
David Kelly
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] dvips function gives Documents not found error

2003-11-27 Thread Dirk Eddelbuettel
On Thu, Nov 27, 2003 at 04:21:04PM -0800, David Kelly wrote:
 Frank Harrell wrote:
 
  Did you make the changes I suggested (surrounding two items by
  dQuote())?
 
  Have you tried Linux?
 
 No, I didn't make those changes because I've just been working with a 
 binary distribution. I may go ahead and pull down sources and try; I was 

But that's the beauty of it -- even in Windoze, the $R_HOME/library/$FOO/R/
directory for a package $FOO contains simple text code which you can edit.

If you know how to read and write S source code, I may take you only about
one minute to locate the file, and insert the suggested dQuote().

 trying to avoid that.
 
 I wish I were working with Linux, but I'm doing this work for someone 
 with many installed PCs that want to use R, and they're all running 
 Win2K and that isn't going to change.

If you organise your work environment wel, operating systems matter less and
less. R, Perl, Python, ... are pretty much completely cross-platform (unless
you insist on using OS-specific features). 

Dirk


-- 
Those are my principles, and if you don't like them... well, I have others.
-- Groucho Marx

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] dvips function gives Documents not found error

2003-11-24 Thread Frank E Harrell Jr
On Mon, 24 Nov 2003 10:53:48 + (GMT)
Prof Brian Ripley [EMAIL PROTECTED] wrote:

 This is a question about Hmisc, I believe, although you certainly did
 not mention it.  Looking at the source code I see
 
 sys(paste(cd, tempdir(), sc, optionsCmds(latex), tmp))
 
 do my guess is that it is writing .dvi files in tempdir().
 If you look up help on tempdir() you will see how to avoid this,
 
 Moral: don't guess, and don't make your readers guess either.
 
 And to Frank Harrell as author of Hmisc: spaces are valid in file names 
 even on Unix/Linux, so it would be nice if this could be corrected.

I've resisted this until now.  The fix appears to be to surround tempdir()
and tmp by dQuote( ). This will be in the next release.  I'm assuming that
superfluous quotes never hurt.   -Frank
---
Frank E Harrell JrProfessor and ChairSchool of Medicine
  Department of BiostatisticsVanderbilt University

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] dvips function gives Documents not found error

2003-11-24 Thread David Kelly
Thanks to you both for your suggestions, and great to hear from the 
author himself!

I may be thick, but I'm still having the problem. I did look at help for 
tempdir(), but tempdir() just *returns* the directory that's used; it 
doesn't allow me to change it.  As a slightly different tack, I tried 
using tempfile(dsk,\\kellytest)
but I still got the same error.

From looking at the source code line mentioned below, I wouldn't expect 
the tempfile() call that I tried to make a difference anyway.

So: Is there someway I can change the value of tempdir() so I can 
influence Hmisc?  Also, in the source line quoted below, what is tmp 
and do I have some way to change that to give it a path without spaces?

I'm looking for a workaround here to allow to do some further 
testing/prototyping, not a permanent fix.

Thanks again --
David Kelly
--
On Mon, 24 Nov 2003 10:53:48 + (GMT)
Prof Brian Ripley [EMAIL PROTECTED] wrote:
 This is a question about Hmisc, I believe, although you certainly did
 not mention it.  Looking at the source code I see

 sys(paste(cd, tempdir(), sc, optionsCmds(latex), tmp))

 do my guess is that it is writing .dvi files in tempdir().
 If you look up help on tempdir() you will see how to avoid this,

 Moral: don't guess, and don't make your readers guess either.

 And to Frank Harrell as author of Hmisc: spaces are valid in file names
 even on Unix/Linux, so it would be nice if this could be corrected.
I've resisted this until now.  The fix appears to be to surround tempdir()
and tmp by dQuote( ). This will be in the next release.  I'm assuming that
superfluous quotes never hurt.   -Frank
---
Frank E Harrell JrProfessor and ChairSchool of Medicine
  Department of BiostatisticsVanderbilt University
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] dvips function gives Documents not found error

2003-11-24 Thread Duncan Murdoch
On Mon, 24 Nov 2003 11:09:17 -0800, David Kelly [EMAIL PROTECTED]
wrote:


So: Is there someway I can change the value of tempdir() so I can 
influence Hmisc?  

Not after R has started, but if you set the TMP or TEMP environment
variable to the name of an existing directory, that will be used as
the base of temp directories.  You can do this on the R command line,
e.g. set the Target field in the R shortcut to 

C:\R\rw1081\bin\Rgui.exe TMP=c:/junk

More on this is in ?tempdir and ?Startup.

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] dvips function gives Documents not found error

2003-11-23 Thread David Kelly
I'm new to R, and using version 1.8.0 on Windows XP, under emacs/ess. 
I'm trying to test some simple output flow using functions in the Hmisc 
package and hit an error that may be a more general problem than just my 
specific situation.

If I issue the command
latex(describe(mtcars), file = )
I get what looks like good TeX code output to the console.
However, if I issue the command
dvips(latex(describe(mtcars)),file=friday.ps)
I get the following error:
Error in system(cmd, intern = intern, wait = wait | intern, 
show.output.on.console = wait,  :
C:/Documents not found

and I don't find any postscript output file.

I'm guessing the C:/Documents reference is actually a problem with 
something dealing with paths with embedded spaces and that it's failing 
to deal with a path like C:/Documents and Settings/

What I've been unable to figure out is what file reference it's 
hiccuping on, so that I can hopefully find a workaround.  I tried 
several things without any change in behavior:
- insuring that the working directory for R didn't have any spaces in 
the pathname.
- changing my TEMP and TMP environment variables to paths without any 
spaces.
- in the possibility that some piece of software (emacs, R, LaTex) was 
looking for the TMPDIR environment variable, tried setting that to a 
path without any spaces.

Any ideas, suggestions for further experiments, or solutions would be 
welcome!  A copy of any reply to my email address (as well as just 
posting to the list) would be appreciated.

Thank you -
David Kelly
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help