[R] "Use a command like x <- vi() to recover"

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Feb 3 23:33:32 CET 2000


Griffith Feeney <gfeeney at hawaii.edu> writes:

> Subject command doesn't work with rw0901 running on win95 (of course) so,
> after looking at the vi and emacs code, I put
> 
> textpad <- function(name = NULL, file = ""){
> edit(name, file, editor = "g:\\textpad\\txtpad32.exe")
> }
> 
> Now
> 
> x <- textpad()

Um, yes, that error message would be better as "use a command like x
<- edit()", especially in the upcoming R where edit() will call up
getOption("editor"). And in windows that would give you the Notepad
(for better or worse...).

> brings up the botched code in the textpad editor, as expected, but when I
> try to save changes I get an "Access to D:\s3vvkogv was denied" message
> from the editor. The only way I've found to recover is to restart R, and
> the changes in the edited function are lost. This is a nuisance, to say the
> least. Can anyone tell me a better way to handle this?

I've seen similar effects with W9x processes apparently fighting over
a file in ways that wouldn't happen on Unix. Looks like textpad
says that R is holding the file open. (I believe it was editing the
Rprofile with R running that turned out to be taboo for me at some
point). 

A fairly obvious workaround is to save the edited file to another name
and then source that into R (or x <- edit(file="c:\\whatever").

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list