Start a Shiny server for the given document, and render it for display.
runHOAD(...)
... | Arguments passed on to
|
---|
Invisible NULL.
The run
function runs a Shiny document by starting a Shiny
server associated with the document. The shiny_args
parameter can be
used to configure the server; see the runApp
documentation for details.
Once the server is started, the document will be rendered using
render
. The server will initiate a render of the document
whenever necessary, so it is not necessary to call run
every time
the document changes: if auto_reload
is TRUE
, saving the
document will trigger a render. You can also manually trigger a render by
reloading the document in a Web browser.
The server will render any R Markdown (.Rmd
) document in dir
;
the file
argument specifies only the initial document to be
rendered and viewed. You can therefore link to other documents in the
directory using standard Markdown syntax, e.g.
[Analysis Page 2](page2.Rmd)
.
If default_file
is not specified, nor is a file specified on the
URL, then the default document to serve at /
is chosen from (in
order of preference):
If dir
contains only one Rmd
, that Rmd
.
The file index.Rmd
, if it exists in dir
.
The first Rmd
that has runtime: shiny
in its YAML metadata.
The file index.html
(or index.htm
), if it exists in dir
.
If you wish to share R code between your documents, place it in a file
named global.R
in dir
; it will be sourced into the global
environment.
#> Warning: path[1]="index.Rmd": No such file or directory#> Warning: cannot open file 'index.Rmd': No such file or directory#> Error in readLines(con, warn = FALSE): cannot open the connection# Run the Shiny document "shiny_doc.Rmd" on port 8241 rmarkdown::run("shiny_doc.Rmd", shiny_args = list(port = 8241))#> Warning: path[1]="shiny_doc.Rmd": No such file or directory#> Warning: cannot open file 'shiny_doc.Rmd': No such file or directory#> Error in readLines(con, warn = FALSE): cannot open the connection# }