Description Usage Arguments Details Value Examples See Also
If a package with the same name as a disposable one, is
loaded, then it will be unloaded. If a package with same name
as a disposable on is installed in lib_dir
, then
it will be overwritten. (lib_dir
is usually a temporary
directory, so this is not a big problem.)
1 2 | make_packages(..., lib_dir = tempfile(), imports = character(),
quiet = TRUE)
|
... |
Named expressions. A separate package with the given name is created for each. |
lib_dir |
Directory to install the package to. Defaults to a temporary directory that is deleted once the R session is over. |
imports |
The 'Imports' field in the DESCRIPTION file, the packages to import in each disposable package. It can be a character vector, which applies to all packages, or a list of character vectors, one for each package. |
quiet |
Whether to show the installation process of disposable packages. |
Note that if you specify lib_dir
and it points to an
existing directory, make_package
overwrites the packages
there. If an error happens during installation or loading of
the disposables packages, then it will not restore the
original contents of lib_dir
, but it will remove
all newly installed disposable packages, even the ones
that were installed cleanly.
A named list with entries:
lib_dir
The directory in which the packages are
installed.
package
The named of the packages.
1 2 3 4 5 6 7 8 9 | pkg <- make_packages(
foo1 = { f <- function() print("hello!") ; d <- 1:10 },
foo2 = { f <- function() print("hello again!") ; d <- 11:20 }
)
foo1::f()
foo2::f()
foo1::d
foo2::d
dispose_packages(pkg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.