Skip to content
Prev 17721 / 398502 Next

Is it possible to open a specific file in the HTML browser like help(htmlhelp=TRUE) does?

Ok, so here is something that works for windows and unix
openBrowser <- function (query) 
{
    OST <- .Platform$OS.type
    if (OST == "windows") {
        shell.exec(query)
    }
    else if (OST == "unix") {
        if (is.null(getOption("browser"))) 
            stop("options(\"browser\") not set")
        browser <- getOption("browser")
        system(paste(browser, " -remote \"openURL(", query, ")\"
	2>/dev/null || ", 
            browser, " ", query, " &", sep = ""))
    }
    else {
        msg <- paste("don't know how to open the browser on", 
            OST)
        stop(msg)
    }
    return(NULL)
}
On Thu, Mar 07, 2002 at 09:22:49PM -0800, Zed Shaw wrote:

  
    
Message-ID: <20020308071605.V11590@jimmy.harvard.edu>
In-Reply-To: <1015564969.3484.4.camel@workhorse.killnine.net>; from zedshaw@zedshaw.com on Thu, Mar 07, 2002 at 09:22:49PM -0800