[R-SIG-Mac] drag & drop on R icon not changing directory

Ken Knoblauch ken.knoblauch at inserm.fr
Tue Nov 6 19:53:52 CET 2012


I confirm that it does work on my systems with directories and gives the new
behavior of printing out the setwd() command that was executed.
It used to work with text files (mostly .R scripts), but it no longer
does.  I don't remember if it was undocumented, but I did get
into the habit of doing this and will have to break the habit if it
is gone for good.

Dragging a text file on Rstudio works in opening and setting the  
directory, but that's for another list, I guess.

Thank you.

best,

Ken

Quoting Prof Brian Ripley <ripley at stats.ox.ac.uk>:

> On 06/11/2012 17:30, David Winsemius wrote:
>>
>> On Nov 6, 2012, at 6:05 AM, Ken Knoblauch wrote:
>>
>>> Hi,
>>>
>>> just noticed this in R version 2.15.2 Patched (2012-11-04 r61084),
>>> that dragging a file onto the R icon when starting a session is not
>>> changing to the directory of the file.
>>>
>>> sessionInfo()
>>> R version 2.15.2 Patched (2012-11-04 r61084)
>>> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>>>
>>> locale:
>>> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>>>
>>> attached base packages:
>>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>>
>>> Thanks.
>>
>> I'm a bit puzzled by this. I never in the past expected that the   
>> working directory would be changed when doing this. Are you saying   
>> I should have expected the working directory to change when a file   
>> icon was dragged on top of the R-dock icon? What should I be   
>> reading that I missed?
>
> The MacOSX FAQ?  But that is not a very reliable document (less
> unreliable in 2.15.2 than in the recent past).
>
> http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Drag-_0026-drop
>
> seems to say the directory is changed if a directory is dropped, but
> not say so for other types of files (and it may depend on the type of
> file).
>
> Works as documented for directories, at least.
>
>
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> 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, UK                Fax:  +44 1865 272595



-- 
Ken Knoblauch
Inserm U846
Stem-cell and Brain Research Institute
Department of Integrative Neurosciences
18 avenue du Doyen Lépine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
http://www.sbri.fr/members/kenneth-knoblauch.html



More information about the R-SIG-Mac mailing list