[R] R command to open a file browser on Windows and Mac?

2015-08-03 Thread Jonathan Greenberg
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@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.


Re: [R] R command to open a file browser on Windows and Mac?

2015-08-03 Thread Duncan Murdoch
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

__
R-help@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.


Re: [R] R command to open a file browser on Windows and Mac?

2015-08-03 Thread Mark Sharp
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: msh...@txbiomed.org







 On Aug 3, 2015, at 10:19 AM, Jonathan Greenberg j...@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@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.

__
R-help@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.

Re: [R] R command to open a file browser on Windows and Mac?

2015-08-03 Thread Barry Rowlingson
And for completeness, on linux:

system(paste0(xdg-open ,getwd()))

there's a function in a package somewhere that hides the system
dependencies of opening things with the appropriate application, and
if you pass a folder/directory to it I reckon it will open it in the
Explorer/Finder/Nautilus//xfm//This Month's Linux File Browser// as
appropriate.

But I can't remember the name of the function or the package.

Barry



On Mon, Aug 3, 2015 at 4:19 PM, Jonathan Greenberg j...@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@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.

__
R-help@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.