Commit 86875148 authored by Aadil M. Alli's avatar Aadil M. Alli

Added R Example in FAQ

parent c1d081e7
...@@ -318,23 +318,27 @@ Deactivate the environment if it's active: ...@@ -318,23 +318,27 @@ Deactivate the environment if it's active:
``` ```
deactivate deactivate
``` ```
**R Example** **R Example**
Below are directions on using a simple virtual environment with renv. It is one of the main packages used to manage virtual environments in R. Below are directions on using a simple virtual environment with renv. It is one of the main packages used to manage virtual environments in R.
Create a new project and initialize renv: Create a virtual environment:
``` ```
renv::init() renv::init()
``` ```
Activate the environment: Activate the environment:
``` ```
renv::activate() renv::activate()
``` ```
Install a package: Your current line should be prefixed with the environment name:
``` ```
install.packages("package_name") (research1) user@super-computer
``` ```
Deactivate an environment: Install new package:
``` ```
renv::deactivate() install.packages("package_name")
``` ```
\ No newline at end of file Deactivate the environment if it's active:
```
renv::deactivate()
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment