pin_assets | R Documentation |
Pin files or directories that need to be available on both branches when
running the touchstone_script. During benchmark_run()
they will
available via path_pinned_asset()
. This is only possible for assets
within the git repository.
pin_assets(
...,
branch = branch_get_or_fail("GITHUB_HEAD_REF"),
overwrite = TRUE
)
... |
Any number of directories or files, as strings, that you want to access in your touchstone_script. |
branch |
The branch the passed assets are copied from. |
overwrite |
Overwrite files if they exist. If this is |
When passing nested directories or files within nested directories the path will be copied recursively. See examples.
The asset directory invisibly.
## Not run:
# In the touchstone script within the repo "/home/user/pkg"
pin_assets(c("/home/user/pkg/bench", "inst/setup.R", "some/nested/dir"))
source(path_pinned_asset("inst/setup.R"))
load(path_pinned_asset("some/nested/dir/data.RData"))
touchstone::benchmark_run(
expr_before_benchmark = {
!!setup
source(path_pinned_asset("bench/exprs.R"))
},
run_me = some_exprs(),
n = 6
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.