[R] Mac Os X 10.6.8, R and edit/vi

MacQueen, Don macqueen1 at llnl.gov
Fri Aug 9 00:09:35 CEST 2013


This is a question for R-sig-mac.

However, try

  edit(file=file.choose())

Also, before your edit() command, try

  getwd()

Is the file in that directory??

-Don
-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 8/8/13 7:51 AM, "David Epstein" <David.Epstein at warwick.ac.uk> wrote:

>I tried using various versions of the 'edit' command. Here is an account
>of
>how this failed. I hope I have included all relevant information.
>
>I haven't used R for a couple of years. Before restarting with R, I
>downloaded the latest version I could find in its binary version, and
>installed it without any problems.
>Mac Os X Finder command "About R" responds with
>R 3.0.1 GUI 1.61 Snow Leopard build (6492)
>
>From inside R
>>version
>                  
>> platform       x86_64-apple-darwin10.8.0
>> arch           x86_64
>> os             darwin10.8.0    #(However, my os is in fact 10.6.8)
>>    
>> system         x86_64, darwin10.8.0
>> status          
>> major          3
>> minor          0.1
>> year           2013
>> month          05
>> day            16
>> svn rev        62743
>> language       R
>> version.string R version 3.0.1 (2013-05-16)
>> nickname       Good Sport
>> 
>>edit(file='2.9.R')
>> Error in file(con, "r") : cannot open the connection
>> In addition: Warning message:
>> In file(con, "r") : cannot open file '2.9.R': No such file or directory
>> 
>>getOption('editor')
>[1] "vi"
>
>>edit(file='2.9.R',editor='/opt/local/bin/vim')
>> Error in file(con, "r") : cannot open the connection
>> In addition: Warning message:
>> In file(con, "r") : cannot open file '2.9.R': No such file or directory
>> 
>>vi(file='try')
>> Error in file(con, "r") : cannot open the connection
>> In addition: Warning message:
>> In file(con, "r") : cannot open file 'try': No such file or directory
>> 
>And here is my interaction with tcsh (my default shell)
>H2:~% echo $VISUAL
>/opt/local/bin/vim
>H2:~% echo $EDITOR
>/opt/local/bin/vim
>H2:~% which vi
>vi:   aliased to /opt/local/bin/vim
>H2:~/<4>Chap2% ls -ld
>drwxr-xr-x  11 dbae  dbae  374  8 Aug 10:54 ./
>
>
>What am I doing wrong?
>Thanks for any help.
>David
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list