Skip to content
Open
Changes from all commits
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
21 changes: 20 additions & 1 deletion source/compute/software/vsc_rproject.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@ The ``activate`` sub-command can be used to activate an already existing vsc-Rpr
Activating a vsc-Rproject environment will load all the relevant modules listed in the modules file and
set the ``$VSC_RPROJECT`` environment variable which can be used to access the root directory of the project.

.. note::

To open a project via the commandline, you simply need to launch R from within your project root folder:

.. code:: bash

vsc-rproject activate MyProject
cd $VSC_RPROJECT
R


.. _deactivating_a_project:

Deactivating a project
Expand Down Expand Up @@ -215,4 +226,12 @@ When launching a new session via the :ref:`Studio Server <rstudio-server>` app i
The R module selected in the OnDemand form must match the R module that was used to create the project!
Otherwise dependency conflicts may arise as RStudio Server will replace the modules loaded via the pre-run scriplet.

Once inside the RStudio session, you still need to open the RStudio Project via the interface.
In order to use this project within the RStudio session, you still need to open the RStudio Project via the interface:
File > Open Project...

Using the Environment and installing software
---------------------------------------------

Once your project has been opened (either in RStudio or via the commandline), you should see a welcome message pointing you to the project folder and listing all known library paths.
The first library path should point to the project's own library itself.
When loading packages (e.g. ``library(<packagename>)``) or installing packages (e.g.``install.packages(<packagename>)``) R prioritizes the first library path.
Comment on lines +232 to +237
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is indeed better, but I would still like to see this higher up the page because it describes an important part of how vsc-Rproject works. So I'd suggest to for example put it in a new subsection in between Activating a project and Deactivating a project (perhaps calling it Adding R packages to the project?).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I like this idea. That section is explaining one by one the different subcommands create, activate, deactivate, and configure. Installing packages in an RStudio Project is not something specific to vsc-Rproject. vsc-Rproject just facilitates the setup of your project directory and the package libary in a correct way.
The moment the project is created the job of vsc-Rproject is pretty much done. All it then needs to do is make sure the correct modules are in place whenever you want to use it.
Installing packages in the project's package library, whether via command line R or RStudio does not dependent on vsc-Rproject anymore. That is why I have these two separate sections ("vsc-Rproject and RStudio Server" and "Using the Environment and installing software") at the end of the page.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The argument that this does not correspond to a specific vsc-Rproject subcommand does not hold. What counts is what happens from a user perspective. The main and perhaps only reason they are using vsc-Rproject is to install their own R packages, and so that step is as essential as the vsc-Rproject subcommands themselves. If you check our pages on Python, Conda, and the like, will see the same create-environment/activate-environment/install-stuff-in-environment/deactivate-environment structure ;)