Add env parameter to installspec (#743)
- add-env-parameter
Allow the user to define environment variables when running installspec()
Fix tests
Throw error instead of silently ignoring
fix use of named list
Co-authored-by: Philipp A flying-sheep@web.de
Native R kernel for Jupyter

For detailed requirements and install instructions see irkernel.github.io
Requirements
Installation
This package is available on CRAN:
Per default
IRkernel::installspec()will install a kernel with the name “ir” and a display name of “R”. Multiple calls will overwrite the kernel with a kernel spec pointing to the last R interpreter you called that commands from. You can install kernels for multiple versions of R by supplying anameanddisplaynameargument to theinstallspec()call (You still need to install these packages in all interpreters you want to run as a jupyter kernel!):By default, it installs the kernel per-user. To install system-wide, use
user = FALSE. To install in thesys.prefixof the currently detectedjupytercommand line utility, usesys_prefix = TRUE.Now both R versions are available as an R kernel in the notebook.
If you encounter problems during installation
Running the notebook
If you have Jupyter installed, you can create a notebook using IRkernel from the dropdown menu.
You can also start other interfaces with an R kernel:
Run a stable release in a Docker container
Refer to the jupyter/docker-stacks r-notebook repository
If you have a Docker daemon running, e.g. reachable on localhost, start a container with:
Open localhost:8888 in your browser. All notebooks from your session will be saved in the current directory.
On other platforms without docker, this can be started using
docker-machineby replacing “localhost” with an IP fromdocker-machine ip <MACHINE>. With the deprecatedboot2docker, this IP will beboot2docker ip.Develop and run from source in a Docker container
How does it know where to install?
The IRKernel does not have any Python dependencies whatsoever, and does not know anything about any other Jupyter/Python installations you may have. It only requires the
jupytercommand to be available on$PATH. To install the kernel, it prepares a kernelspec directory (containingkernel.jsonand so on), and passes it to the command linejupyter kernelspec install [options] prepared_kernel_dir/, where options such as--name,--user,--prefix, and--sys-prefixare given based on the options.