EVOLUTION-MANAGER
Edit File: browseURL.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Load URL into an HTML Browser</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for browseURL {utils}"><tr><td>browseURL {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Load URL into an HTML Browser</h2> <h3>Description</h3> <p>Load a given URL into an HTML browser. </p> <h3>Usage</h3> <pre> browseURL(url, browser = getOption("browser"), encodeIfNeeded = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>url</code></td> <td> <p>a non-empty character string giving the URL to be loaded. Some platforms also accept file paths. </p> </td></tr> <tr valign="top"><td><code>browser</code></td> <td> <p>a non-empty character string giving the name of the program to be used as the HTML browser. It should be in the PATH, or a full path specified. Alternatively, an <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> function to be called to invoke the browser. </p> <p>Under Windows <code>NULL</code> is also allowed (and is the default), and implies that the file association mechanism will be used. </p> </td></tr> <tr valign="top"><td><code>encodeIfNeeded</code></td> <td> <p>Should the URL be encoded by <code><a href="URLencode.html">URLencode</a></code> before passing to the browser? This is not needed (and might be harmful) if the <code>browser</code> program/function itself does encoding, and can be harmful for <span class="samp">file://</span> URLs on some systems and for <span class="samp">http://</span> URLs passed to some CGI applications. Fortunately, most URLs do not need encoding.</p> </td></tr> </table> <h3>Details</h3> <dl> <dt>On Unix-alikes:</dt><dd> <p>The default browser is set by option <code>"browser"</code>, in turn set by the environment variable <span class="env">R_BROWSER</span> which is by default set in file ‘<span class="file"><var><a href="../../base/html/Rhome.html">R_HOME</a></var>/etc/Renviron</span>’ to a choice made manually or automatically when <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> was configured. (See <code><a href="../../base/html/Startup.html">Startup</a></code> for where to override that default value.) To suppress showing URLs altogether, use the value <code>"false"</code>. </p> <p>On many platforms it is best to set option <code>"browser"</code> to a generic program/script and let that invoke the user's choice of browser. For example, on macOS use <code>open</code> and on many other Unix-alikes use <code>xdg-open</code>. </p> <p>If <code>browser</code> supports remote control and <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> knows how to perform it, the URL is opened in any already-running browser or a new one if necessary. This mechanism currently is available for browsers which support the <code>"-remote openURL(...)"</code> interface (which includes Mozilla and Opera), Galeon, KDE konqueror (<em>via</em> kfmclient) and the GNOME interface to Mozilla. (Firefox has dropped support, but defaults to using an already-running browser.) Note that the type of browser is determined from its name, so this mechanism will only be used if the browser is installed under its canonical name. </p> <p>Because <code>"-remote"</code> will use any browser displaying on the X server (whatever machine it is running on), the remote control mechanism is only used if <code>DISPLAY</code> points to the local host. This may not allow displaying more than one URL at a time from a remote host. </p> <p>It is the caller's responsibility to encode <code>url</code> if necessary (see <code><a href="URLencode.html">URLencode</a></code>). </p> <p>To suppress showing URLs altogether, set <code>browser = "false"</code>. </p> <p>The behaviour for arguments <code>url</code> which are not URLs is platform-dependent. Some platforms accept absolute file paths; fewer accept relative file paths. </p> </dd> <dt>On Windows:</dt><dd> <p>The default browser is set by option <code>"browser"</code>, in turn set by the environment variable <span class="env">R_BROWSER</span> if that is set, otherwise to <code>NULL</code>. To suppress showing URLs altogether, use the value <code>"false"</code>. </p> <p>Some browsers have required <code>:</code> be replaced by <code>|</code> in file paths: others do not accept that. All seem to accept <code>\</code> as a path separator even though the RFC1738 standard requires <code>/</code>. </p> <p>To suppress showing URLs altogether, set <code>browser = "false"</code>. </p> </dd> </dl> <h3>URL schemes</h3> <p>Which URL schemes are accepted is platform-specific: expect <span class="samp">http://</span>, <span class="samp">https://</span> and <span class="samp">ftp://</span> to work, but <span class="samp">mailto:</span> may or may not (and if it does may not use the user's preferred email client). </p> <p>For the <span class="samp">file://</span> scheme the format accepted (if any) can depend on both browser and OS. </p> <h3>Examples</h3> <pre> ## Not run: ## for KDE users who want to open files in a new tab options(browser = "kfmclient newTab") browseURL("https://www.r-project.org") ## On Windows-only, something like browseURL("file://d:/R/R-2.5.1/doc/html/index.html", browser = "C:/Program Files/Mozilla Firefox/firefox.exe") ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>