Description Usage Arguments Details Value Syntactic Sugars Warning See Also Examples
Import or re-import a module which is defined in an R, R Markdown or R Sweave script at a given URL using the HTTP(S) protocol.
1 |
name |
A string (character vector of lenght one). A module name can contain letters, figures and some special characters,
namely Names containing The name "modulr" corresponds to a special module and is therefore reserved. |
url |
A string (character vector of length one). The URL must use the HTTP(S) protocol. |
... |
Further arguments passed to |
digest |
A string (character vector of length one). See
|
force |
A flag. Should an already defined module be re-imported? |
R Markdown and R Sweave files are accordingly tangled into R code, which is in turn evaluated.
The imported module is rejected if
its name differs from the name
argument,
its digest differs from the digest
argument.
In such a case, the internal state of modulr is rolled back.
The result of the evaluation of the imported script.
1 |
1 |
It is considered a very bad practice to define, touch, undefine, load, make, reset, or perform any other operation from within a module definition that may alterate the internal state of modulr.
httr::GET
, get_digest
,
list_modules
, make
, and
make_tests
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
reset()
# https://gist.github.com/aclemen1/3fcc508cb40ddac6c1e3
"modulr/vault" %imports%
"https://gist.github.com/aclemen1/3fcc508cb40ddac6c1e3"
list_modules()
reset()
# equivalently
"modulr/vault" %imports% "3fcc508cb40ddac6c1e3"
make("modulr/vault/example")
make_tests()
## End(Not run)
## Not run:
reset()
# https://gist.github.com/aclemen1/3fcc508cb40ddac6c1e3
"modulr/vault_with_a_typo" %imports% "3fcc508cb40ddac6c1e3"
list_modules()
## End(Not run)
## Not run:
reset()
# https://gist.github.com/aclemen1/3fcc508cb40ddac6c1e3
"modulr/vault" %digests%
"with a wrong digest" %imports%
"3fcc508cb40ddac6c1e3"
list_modules()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.