Description Usage Arguments Functions Examples
Create and manipulate namespace and test package environments.
1 2 3 4 5 6 7 8 9 | new_namespace_env(name, path = file.path(tempdir()), import = "methods")
new_pkg_environment(name = "test package environment", ..., register = FALSE)
register_namespace(ns)
unregister_namespace(ns)
is_namespace_registered(ns)
|
name |
The name of the environment |
path |
An optional path. |
import |
Package to include in the imports. |
... |
Arguments passed on to |
register |
Should the package namespace be registered? |
ns |
a namespace environment or a character name of a namespace. |
new_namespace_env
: Create a new namespace environment
new_pkg_environment
: Create a package environment.
All package environments are namespaces but not all
namespaces qualify as package environments.
register_namespace
: Register a namespace
unregister_namespace
: Remove a namespace from the registry
is_namespace_registered
: Check if a namespace is registered
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ns <- new_namespace_env('my namespace')
isNamespace(ns)
environmentName(ns)
packageName(ns) # not a package
pkg <- new_pkg_environment("myPackage")
isNamespace(pkg)
environmentName(pkg)
packageName(pkg) # now a package
is_namespace_registered(pkg) # but not registered
## Not run:
asNamespace("myPackage") # so this WILL NOT work.
## End(Not run)
register_namespace(pkg)
is_namespace_registered(pkg) # now registered
asNamespace("myPackage") # so this WILL work.
unregister_namespace(pkg)
is_namespace_registered(pkg) # now unregistered
isNamespace(pkg) # but still a namespace
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.