Jonathan Greenberg
2015-Aug-03 15:19 UTC
[R] R command to open a file "browser" on Windows and Mac?
Folks: Is there an easy function to open a finder window (on mac) or windows explorer window (on windows) given an input folder? A lot of times I want to be able to see via a file browser my working directory. Is there a good R hack to do this? --j [[alternative HTML version deleted]]
Duncan Murdoch
2015-Aug-03 15:27 UTC
[R] R command to open a file "browser" on Windows and Mac?
On 03/08/2015 11:19 AM, Jonathan Greenberg wrote:> Folks: > > Is there an easy function to open a finder window (on mac) or windows > explorer window (on windows) given an input folder? A lot of times I want > to be able to see via a file browser my working directory. Is there a good > R hack to do this?On Windows, shell.exec(dir) will open Explorer at that directory. (It'll do something else if dir isn't a directory name, or has spaces in it without quotes, so you need to be a little careful.) On OSX, system2("open", dir) should do the same. Duncan Murdoch
Mark Sharp
2015-Aug-03 15:29 UTC
[R] R command to open a file "browser" on Windows and Mac?
Set your path with setwd(?my_path?) and then use file.choose(). You could have gotten this information sooner with a simple online search. Mark R. Mark Sharp, Ph.D. Director of Primate Records Database Southwest National Primate Research Center Texas Biomedical Research Institute P.O. Box 760549 San Antonio, TX 78245-0549 Telephone: (210)258-9476 e-mail: msharp at TxBiomed.org> On Aug 3, 2015, at 10:19 AM, Jonathan Greenberg <jgrn at illinois.edu> wrote: > > Folks: > > Is there an easy function to open a finder window (on mac) or windows > explorer window (on windows) given an input folder? A lot of times I want > to be able to see via a file browser my working directory. Is there a good > R hack to do this? > > --j > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.