Description Usage Arguments Details See Also Examples
It collects all dependencies' versions and stores them in lock file to enforce exact dependency versions in the future.
1 | prj_lock_env(prj = NULL)
|
prj |
project object to be locked. If not passed the loaded project will be locked or the default whichever exists. Will init default project from the working directory if no default project exists. (type: rsuite_project, default: NULL) |
The lock file is saved in <my_project>/deployment/ under 'env.lock' name. It is in dcf format with information about packages installed in local project environment together with their versions. A sample record from the lock file:
Package: RSuite
Version: 0.26.235
When dependencies are being installed (using prj_install_deps
)
the 'env.lock' file will be used to detect whether any package will change
versions. If that's the case a warning message will be displayed like this:
...:rsuite: The following packages will be updated from the last lock: colorspace
The feature allows preventing errors caused by newer versions of packages which might work differently than previous versions used in the project.
Other in project management: prj_build
,
prj_clean_deps
, prj_init
,
prj_install_deps
, prj_load
,
prj_pack
, prj_start_package
,
prj_start
, prj_unload
,
prj_zip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # create exemplary project base folder
prj_base <- tempfile("example_")
dir.create(prj_base, recursive = TRUE, showWarnings = FALSE)
# start project
prj <- prj_start("my_project", skip_rc = TRUE, path = prj_base)
# build project local environment
prj_install_deps(prj = prj)
# lock project environment
prj_lock_env(prj = prj)
# present contents of lock file created
cat(readLines(file.path(prj$path, "deployment", "env.lock")), sep = "\n")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.