RStudio in IDAS
On this page:
Accessing R in IDAS
For research users
Summary
R can be used with both RStudio and JupyterLab in IDAS.
When you log in to IDAS, you can choose the default interface (RStudio or JupyterLab).
In the Server Options form, under IDAS Image:
Choose an RStudio option, such as
IDAS-R-RStudio-4.4.1
, to start RStudio.Choose an R option, such as
IDAS-R-4.4.1
, to start JupyterLab.
In JupyterLab:
Click the R tile under Notebook to start a Jupyter Notebook with R.
Click the RStudio tile under Notebook to start RStudio.
See the steps below for more details.
1. Follow the steps here to log in to IDAS: Accessing IDAS for Research Use
2. In the Server Options form, click on the drop down menu under IDAS Image:
3. Under IDAS Image, choose one of the options for R or RStudio.
4. If you choose one of the RStudio options under IDAS Image, for example, IDAS-R-RStudio-4.4.1, you will see RStudio after your session starts.
From here, you can use RStudio as normal.
5. R can also be used with JupyterLab. If you choose one of the R options under IDAS Image, for example, IDAS-R-4.4.1, you will see JupyterLab after your session starts.
To use Jupyter Notebook with R, click the R tile under Notebook:
This will start a Jupyter Notebook with R:
To use RStudio, click on the RStudio tile under Notebook:
This will open RStudio in a new tab in your web browser:
From here, you can use RStudio as normal.
For class users
When the instructor of the class requests IDAS for the class, they can select a programming language (Python, R, or Julia) and a programming interface (JupyterLab or RStudio). The instructor’s choice will determine what students see when they log in to IDAS.
Instructors can contact research-computing@uiowa.edu if they would like to change the programming language or interface for the class.
Switching between JupyterLab, Jupyter Notebook, and RStudio
The following interfaces are available in IDAS:
JupyterLab - available in all IDAS instances (Python, R, RStudio, and Julia)
Jupyter Notebook - available in all IDAS instances (Python, R, RStudio, and Julia)
RStudio - only available in the R and RStudio instances
Research users can quickly switch between JupyterLab, Jupyter Notebook, and RStudio by changing the URL in their web browser. For more information, please see:Accessing IDAS for Research Use | Switching between JupyterLab, Jupyter Notebook, and RStudio.
For class users, the interfaces that are available will depend on the programming language requested by the instructor of the class.
This rest of this article outlines a few common tasks using RStudio in IDAS. For more information about RStudio, please see the official website for Posit: Posit
Creating and saving R scripts
After creating an IDAS instance for research or class use, you will see the RStudio interface.
To create a new (blank) R script, click File on the menu bar at the top of your RStudio screen, New File, and then R Script.
To save an R script, click File on the menu bar, and then Save As...
In the pop-up box, enter a name for your script in File name. Click to select a destination for your file. (Click Home to go to your home directory anytime). Click Save.
Managing files and folders
In the lower right quadrant of your screen, the Files tab shows your files and folders. If this is your first time using RStudio, your home directory will only have a folder called R.
Click the Home button to go to your home directory anytime.
Under the Files tab, there are a number of options to manage your files and folders.
Below is a summary of these options:
New Folder: create a new folder in your current directory. Enter the folder name, and then click OK.
New Blank File: create a file from a number of options, including new R scripts, R markdown files, etc.
Upload: upload files from your computer to your current directory in IDAS. Select the files in your local computer, and then click OK.
To upload multiple files or a directory, create a zip file, which will be automatically uncompressed after upload.
Delete: permanently delete a file or folder. Check the box next to a file or folder to select it, click Delete, then Yes.
Rename: rename a file or folder. Check the box next to a file or folder to select it, then click Rename. Enter the new name in the pop-up box, then click OK.
Below is a summary of the options available under More:
Copy: make a copy of a file or folder. Check the box next to a file or folder to select it, click More, then Copy, enter a name for the new file or folder, then click OK.
Copy To: make a copy of a file or folder and save the copy to a directory. Check the box next to a file or folder to select it, click More, then Copy To, enter a name for the new file or folder, select a directory, then click Save.
Move: move the file or folder to a directory of your choice. Check the box next to a file or folder to select it, click More, then Move. In the pop-up box, choose a directory, then click Choose.
Export: download files and folders (see below)
Set As Working Directory: navigate to a directory of your choice, then click this option to choose the current directory as the working directory.
Go To Working Directory: click this option to go to the current working directory.
Show Hidden Files: toggle this option to show or hide hidden files, e.g. files that start with a
.
Downloading files and folders
To download a file, check the box next to it. Click More, then Export. Enter a name for the downloaded file, then click Download.
To download a folder, check the box next to it. Click More, then Export. Enter a name for the downloaded file, then click Download. The folder will be downloaded as a .zip file.
To download multiple files and folders, check the boxes next to those files and folders. Click More, then Export. Enter a name for the downloaded file, then click Download. They will be downloaded as a .zip file.
Working with the Terminal in IDAS
The Terminal allows you to perform more tasks in IDAS, including checking system information, managing files and folders, and installing packages. Below are a few common tasks that may be helpful in IDAS.
Accessing the Terminal in RStudio
To access the Terminal, click on the Terminal tab next to the Console tab in RStudio.
This will open a command line interface (the Terminal):
Checking information using the Terminal
The following commands can be typed after the prompt $
in the Terminal:
pwd
: prints the current working directory. If you are in your IDAS home directory, the directory will be/home/HawkID
, whereHawkID
is your HawkID.ls -a
: lists the files and directories in your current directory. The-a
option lists all files, including hidden files that start with.
, such as.bashrc
.cd <destination>
: change directory to a destination directory. For example,cd demo
: changes to thedemo
directorycd
: (with no argument) returns to your home directory
Contact
If you have any questions or comments, please contact mailto:research-computing@uiowa.edu.