set.jupyter.path | R Documentation |
this.path()
does some guess work to determine the path of the
executing notebook in ‘\Jupyter’. This involves listing all the files
in the initial working directory, filtering those which are R notebooks,
then filtering those with contents matching the top-level expression.
This could possibly select the wrong file if the same top-level expression is
found in another file. As such, you can use set.jupyter.path()
to
declare the executing ‘Jupyter’ notebook's filename.
set.jupyter.path(...)
... |
further arguments passed to |
This function may only be called from a top-level context in ‘Jupyter’. It is recommended that you do NOT provide an absolute path. Instead, provide just the basename and the directory will be determined by the initial working directory.
character string, invisibly; the declared path for ‘Jupyter’.
# ## if you opened the file "~/file50b816a24ec1.ipynb", the initial
# ## working directory should be "~". You can write:
#
# set.jupyter.path("file50b816a24ec1.ipynb")
#
# ## and then this.path() will return "~/file50b816a24ec1.ipynb"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.