serve_example | R Documentation |
Use server functions to serve built-in examples of this package.
serve_example(name, FUN, ..., run = interactive())
name |
the directory name of the example under the directory
|
FUN |
a server function that takes the example path as its first
argument, e.g. |
... |
other arguments passed to |
run |
whether to run the example (this is mainly for |
NULL
if run = FALSE
, otherwise the value returned from
FUN()
.
# R Markdown v1 or v2
servr::serve_example("rmd", servr::rmdv1)
servr::serve_example("rmd", servr::rmdv2)
# GNU Make
servr::serve_example("make1", servr::make)
servr::serve_example("make2", servr::make)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.