Description Usage Arguments Details Examples
Pass app updates from a local inst directory to an app in an installed package
1 | add_update(local_pkg, ..., app_name, open_dir = FALSE, update_css = FALSE)
|
local_pkg |
|
... |
Additional directory names passed to |
app_name |
|
open_dir |
|
update_css |
|
This function enables ultra-fast updates to shiny apps without
needing to rebuild the package. It is assumed that two versions
of a package exist on the user's machine. The first version is
an installed package stored in the user's library, while the second
version is a pre-compiled (in-work) version of the package. This
function allows users to pass updates to an app from the in-work
version of the package to the installed version while ensuring that
the app can be deployed/published. Because files in the inst/
directory aren't compiled when packages are built, updates can
be passed to an installed package. This is useful for testing
changes made to an app without re-building the package each time.
The local_pkg
argument can be specified by providing a full file
path to any file in the uncompiled version of the package. The root
directory of the in-work package is located using rprojroot::find_root
.
The root directory of the installed version of the package is located using
devtools::inst()
. Any changes made to an app in the in-work package are
passed to the app within the installed version of the package stored in the
user's package library.
The ...
arguments are passed file.path()
and name the directories
between the package root directory and the app_name/
directory. Note: the
inst
has already been provided and should not be included. For update_css=TRUE
the ...
argument specifies the directories between the package root and the
directory in which the css files are stored.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # In the \code{teachingApps} package, apps are stored in the
# \code{inst/apps/} directory.
## Not run:
teachingApps::add_update(local_pkg = file.choose(),
'apps',
app_name = 'maximum_likelihood')
## End(Not run)
# Open an app directory to make and push updates
## Not run:
teachingApps::add_update(local_pkg = file.choose(),
'apps',
app_name = 'maximum_likelihood',
open_dir = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.