wflow_view | R Documentation |
wflow_view
displays the website locally in your browser or the RStudio
Viewer pane.
wflow_view(files = NULL, latest = FALSE, dry_run = FALSE, project = ".")
files |
character (default: NULL). Name(s) of the specific file(s) to view. These can be either the name(s) of the R Markdown file(s) in the analysis directory or the HTML file(s) in the docs directory. Supports file globbing. |
latest |
logical (default: FALSE). Display the HTML file with the most
recent modification time (in addition to those specified in |
dry_run |
logical (default: FALSE). Do not actually view file(s). Mainly useful for testing. |
project |
character (default: ".") By default the function assumes the current working directory is within the project. If this is not true, you'll need to provide the path to the project directory. |
wflow_view
by default displays the file index.html
. To view the
most recently modified HTML file, set latest = TRUE
. To specify which
file(s) to view, specify either the name(s) of the R Markdown or HTML
file(s).
wflow_view
uses browseURL
to view the HTML files in the
browser. If you wish to do something non-traditional like view an HTML file
that is not in the docs directory or not part of a workflowr project, you can
use that function directly.
If wflow_view
is run in the RStudio IDE and only one file has been
requested to be viewed, the file is displayed in the
RStudio
Viewer.
If R has no default browser set (determined by getOption("browser")
),
then wflow_view
cannot open any HTML files. See
browseURL
for setup instructions.
An object of class wflow_view
, which is a list with the
following elements:
files |
The input argument |
latest |
The input argument |
dry_run |
The input argument |
browser |
Logical indicating if a default browser has been set. If
FALSE, no HTML files can be opened. This is determined by the value
returned by |
opened |
The HTML files opened by |
browseURL
## Not run:
# View index.html
wflow_view()
# View the most recently modified HTML file
wflow_view(latest = TRUE)
# View a file by specifying the R Markdown file
wflow_view("analysis/fname.Rmd")
# View a file by specifying the HTML file
wflow_view("docs/fname.html")
# View multiple files
wflow_view(c("fname1.Rmd", "fname2.Rmd"))
wflow_view("docs/*html")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.