Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update documentation for R package management with conda #393

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 12 additions & 28 deletions source/software/r_package_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,7 @@ Installing Miniconda
~~~~~~~~~~~~~~~~~~~~

If you have Miniconda already installed, you can skip ahead to the next
section, if Miniconda is not installed, we start with that. Download the
Bash script that will install it from
`conda.io <https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh>`_
using, e.g., ``wget``::

$ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

Once downloaded, run the installation script::

$ bash Miniconda3-latest-Linux-x86_64.sh -b -p $VSC_DATA/miniconda3

Optionally, you can add the path to the Miniconda installation to the
PATH environment variable in your ``.bashrc`` file. This is convenient, but
may lead to conflicts when working with the module system, so make sure
that you know what you are doing in either case. The line to add to your
``.bashrc`` file would be::

export PATH="${VSC_DATA}/miniconda3/bin:${PATH}"
section, if Miniconda is not installed please follow our :ref:`guide to installing miniconda <install_miniconda_python>`.

.. _create_r_conda_env:

Expand All @@ -105,17 +88,18 @@ If the result is blank, or reports that conda can not be found, modify
the \`PATH\` environment variable appropriately by adding miniconda's bin
directory to PATH.

Creating a new conda environment is straightforward::
The next step is to create a new conda environment which can be done as follows::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some users are dummies. For such, we have to also mention that they need to pick a specific R version in advance, and substitute that below when <version>. Can you please include a sentence to cover this?


$ conda create -n science -c conda-forge r-base=4.3.2 r-essentials
WouterVanAssche marked this conversation as resolved.
Show resolved Hide resolved


$ conda create -n science -c r r-essentials r-rodbc
This command creates a new conda environment called "science", and installs R 4.3.2
WouterVanAssche marked this conversation as resolved.
Show resolved Hide resolved
from the conda-forge channel as well as the r-essentials bundle which includes number
of commonly used R packages such as ggplot2, glmnet, dplyr, tidyr, and shiny.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following our style for the vsc pages, please change the typesetting for the package names by sandwiching them with opening/closing double-backticks; so that instead of ggplot2, we eventually render ggplot2.


This command creates a new conda environment called science, and
installs a number of R packages that you will probably want to have
handy in any case to preprocess, visualize, or postprocess your data.
You can of course install more, depending on your requirements and
personal taste.
.. note::

A lot of bioconda and bioconductor packages are not in sync with their dependencies, therefore you may need to create a separate environment for each of those packages to avoid conflicts.
A lot of bioconda and bioconductor packages are not in sync with their dependencies, therefore you may need to create a separate environment for each of those packages to avoid conflicts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For bioconda I'm not sure, but with bioconductor this is because there are 2 releases per year, so dependencies can become somewhat older at some point. I would rather say here: start with installing the bioconductor (and bioconda?) packages and let conda figure out the dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not change the content of this remark, I just made it a propper .. note:: . I am not sure what the reason was behind this remark. Do you know @moravveji?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know where this comment comes from, but it is a very relevant one. So, I'd keep it.


Working with the environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -133,7 +117,7 @@ Here, science is the name of the environment you want to work in.
Install an additional package
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To install an additional package, e.g., \`pandas`, first ensure that the
To install an additional package, e.g., \`rodbc`, first ensure that the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of `rodbc, you need to put rodbc` in between opening/closing double-backticks.

environment you want to work in is activated.

::
Expand All @@ -144,7 +128,7 @@ Next, install the package:

::

$ conda install -c r r-ggplot2
$ conda install -c conda-forge r-rodbc

Note that conda will take care of all dependencies, including non-R
libraries. This ensures that you work in a consistent environment.
Expand Down
Loading