Convert path/url to HTML href Tag

Usage

HR(path = "clipboard", text = NULL, new_win = FALSE, copy2clip = interactive(), print = FALSE)

HR2(path = "clipboard", text = NULL, new_win = TRUE, copy2clip = interactive(), print = FALSE)

BT(path = "clipboard", text = NULL, new_win = FALSE, copy2clip = interactive(), print = FALSE)

Arguments

path
A character vector url/path copied to the clipboard. Default is to read from the clipboard. Note that Windows users do not have to reorient slashes in local paths if reading from the clipboard.
text
A character vector of text to hyperref from. Defualt uses the basename of the path.
new_win
logical. If TRUE the link will open in a new window.
copy2clip
logical. If TRUE attempts to copy the output to the clipboard.
print
logical. If TRUE cat prints the output to the console. If FALSE returns to the console.

Value

Returns a character vector of an HTML href tag.

Description

HR - Wrap a path/url to generate an HTML href tag.

HR2 - Convenience version of HR with new_win set to TRUE.

BT - Wrap a path/url to generate an HTML hyperlinked text button tag.

Examples

## HR("assets/img/fry_admin_1.mp4","new") HR(path="http://dl.dropbox.com/u/61803503/Likert.pdf", print = TRUE)
HR("http://cran.r-project.org/", print = TRUE)
HR("http://www.rstudio.com/ide/download/desktop", "click me", print = TRUE)
HR2("https://github.com/trinker/reports", "reports", print = TRUE)
BT("http://trinker.github.io/reports/dependencies", "Click Here!", print = TRUE)