| browse | R Documentation |
link creates a permalink to the remote file and copies it to your
clipboard for easy sharing. This permalink is based on the HEAD commit
of the local git repo.
browse does the same thing, but also opens the website in your default
web browser.
Works with Github, Gitlab, and Bitbucket repos.
browse(path = NULL, remote = "origin") link(path = NULL, remote = "origin")
path |
path to the file. The path may be relative to the current
working directory, or an absolute path.
The default, |
remote |
Name of the remote to link to.
Optionally, you can change by setting
|
In the path argument, you can optionally include line numbers after
the path to the file. See the examples section below. Formatting varies
between Github, Gitlab, and Bitbucket.
## Not run:
# works on an RStudio selection in the editor
browse()
link()
# working directory is the top level of repo
browse("R/browse.R")
link("R/browse.R#L6-L9")
# working directory is the R/ folder of repo
link("../README.md")
# relative or absolute paths to other repos
browse("~/rpackages/dplyr/DESCRIPTION")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.