================
Using MRO in AEN
================

In AEN 4.2.2 and higher, you can choose to create environments with the
Microsoft R Open (MRO) interpreter by installing the ``mro-base`` package,
or create environments with the R interpreter by installing the ``r-base``
package. Unless you request a change, conda will continue to use the
existing interpreter in each environment. In AEN ``r-base`` is the default.

EXAMPLE: To create a custom environment called ``mro_env`` with MRO and R Essentials::

    .. code-block:: bash

        sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda \
            create -c https://repo.continuum.io/pkgs/main \
            -n mro_env r-essentials

NOTE: Conda 4.4 and higher include the ``main`` channel by default. Earlier
versions of conda do not.


Making a default project environment with MRO
---------------------------------------------

You can also create an environment with MRO and make this the default AEN
project environment.

The first time a new project is started, the default project environment is cloned
into the new project's workspace.

#. Create a new conda environment in the ``/opt/wakari/anaconda/envs/default``
   directory.

   The command is similar to the one used in the previous example to create a
   custom environment.

   .. code-block:: bash

       sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda \
           create -c https://repo.continuum.io/pkgs/main \
           -p /opt/wakari/anaconda/envs/default r-essentials

#. Use ``conda`` to install any additional packages into the environment.

#. After the environment is created, clone it to check that it works correctly,
   and then clean up the clone.

   .. code-block:: bash

      sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda \
          create -p /opt/wakari/testenv --clone /opt/wakari/anaconda/envs/default
      sudo -u $AEN_SRVC_ACCT rm -rf /opt/wakari/testenv

NOTE: To convert existing projects, see :ref:`Converting an existing project
<aen-convert-existing-project>`.
