Search code examples
linuxrsshvignette

browsing (or downloading) R vignettes through ssh


I am connected to my work computer (Linux Mint OS) through ssh. I am trying to use a package, but I need to read a documentation. Documentation is available via browseVignettes("package_name"). However since I am connected through the ssh, pdf file does not open. How can I download pdf to my local machine or read it through ssh? Package name is CODEX.

EDIT: I am on Mac OS


Solution

  • R uses the browseUrl function to open URLs in the browser. See https://stat.ethz.ch/R-manual/R-devel/library/utils/html/browseURL.html for more information.

    You can change this option to your own function:

    options(browser = function(url) {cat("R asked to open url: ", url, "\n")} )
    

    Then either use X forwarding to launch a browser on your remote machine (e.g. firefox) and display it on your local screen, or use the SOCKS proxy functionality of SSH to connect via your MacOS browser.