Put this function in .onAttach to check and install node module dependencies on first load. This is useful because some dependencies are binary and can not be hosted on CRAN. Note that it is also run each time a function created by node_fn is called.
1 | check_node_deps(node_package, r_package, node_dir = "node")
|
node_package |
the directory name of the node package in the R package |
r_package |
the package name which wraps the function. Must be specified as the function can't automatically detect the package inside .onAttach |
node_dir |
the directory where node packages are kept. Defaults to 'node', which should be a directory under 'inst' when creaing your own package |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.