Open System Files, 'URLs', Anything

Cross platform solution to open files, directories or 'URLs' with their associated programs.


Linux Build Status Windows Build status CRAN RStudio mirror downloads

Cross platform solution to open files, directories or URLs with their associated programs. Inspired by shell.exec(), https://github.com/pwnall/node-open and https://github.com/sindresorhus/opn

Installation

Once released, you can install xopen from CRAN:

install.packages("xopen")

Usage

library(xopen)

Open a file:

xopen("test.R")

Open a URL:

xopen("https://ps.r-lib.org")

URL with given app:

chrome <- function() {
  switch(
    get_os(),
    win = "Chrome",
    macos = "google chrome",
    other = "google-chrome")
}
xopen("https://processx.r-lib.org", app = chrome())

Open a given app (or switch to it, if already open):

xopen(app = chrome())

App and arguments. (You need to quit Chrome for this to work):

xopen(app = c(chrome(), "--incognito", "https://github.com"))

License

MIT © RStudio

News

1.0.0

First public release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("xopen")

1.0.0 by Gábor Csárdi, 5 months ago


https://github.com/r-lib/xopen#readme


Report a bug at https://github.com/r-lib/xopen/issues


Browse source code at https://github.com/cran/xopen


Authors: Gábor Csárdi [aut, cre] , Fathi Boudra [aut] , Rex Dieter [aut] , Kevin Krammer [aut] , Jeremy White [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports processx

Suggests ps, testthat


Imported by rcmdcheck.


See at CRAN