browseURL               package:utils               R Documentation

_L_o_a_d _U_R_L _i_n_t_o _a _W_W_W _B_r_o_w_s_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     Load a given URL into a WWW browser.

_U_s_a_g_e:

     browseURL(url, browser = getOption("browser"), encodeIfNeeded = FALSE)

_A_r_g_u_m_e_n_t_s:

     url: a non-empty character string giving the URL to be loaded.

 browser: a non-empty character string giving the name of the program
          to be used as hypertext browser.  It should be in the PATH,
          or a full path specified.  Alternatively, an R function to be
          called to invoke the browser. 

encodeIfNeeded: Should the URL be encoded by 'URLencode' before passing
          to the browser?  This is not needed (and might be harmful) if
          the 'browser' program/function itself does encoding, and can
          be harmful for 'file://' URLs on some systems and for
          'http://' URLs passed to some CGI applications. Fortunately,
          most URLs do not need encoding.

_D_e_t_a_i_l_s:

     The default browser is set by option '"browser"', in turn set by
     the environment variable 'R_BROWSER' which is by default set in
     file 'R_HOME/etc/Renviron' to a choice made manually or
     automatically when R was configured.  (See 'Startup' for where to
     override that default value.)

     If 'browser' supports remote control and R 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 '"-remote openURL(...)"' interface (which
     includes Opera 5/6, Mozilla >= 0.9.5 and Mozilla Firefox), Galeon,
     KDE konqueror (via kfmclient) and the GNOME interface to Mozilla. 
     Netscape 7.0 and Opera 7 behave slightly differently, and you will
     need to open them first.  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.

     Because '"-remote"' will use any browser displaying on the X
     server (whatever machine it is running on), the remote control
     mechanism is only used if 'DISPLAY' points to the local host. This
     may not allow displaying more than one URL at a time from a remote
     host.

     It is the caller's responsibility to encode 'url' if necessary
     (see 'URLencode').  This can be tricky for file URLs, where the
     format accepted can depend on the browser and OS.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     ## for KDE users who want to open files in a new tab
     option(browser="kfmclient newTab") 
     browseURL("http://www.r-project.org")
     ## End(Not run)

