File management in this course
1 Simplest ways to obtain the teaching materials
Web \(\rightarrow\) Your PC \(\rightarrow\) Jupyterlab RStudio
All on the cloud
You will need some teaching materials to open in your RStudio. Here you will get tips how to manage files fully interactively, without using a single line of code.
If you can manage files in the unix command line, use Git, or manage files programmatically with R, feel free to skip this tutorial and make use of your superpowers.
2 File explorer in RStudio’s bottom right pane
All around interactive file management happens in the bottom right RStudio pane, the Files
tab.
3 Your RStudio \(\approx\) Your Home Directory
Jupyterlab runs on OS Linux.
Each user was given a home directory to
read files
write (create or edit) files
execute program files.
You can see the entire file structure, but only read or write those folders that the IT admin or their owner made available to you.
Do not delete the
bin
andR
folders.
This tutorial will guide you through the folder structure later. For this moment, let us pretend that you are the only user of this RStudio installation or even on the entire server.
4 Upload from your computer to Jupyterlab RStudio
You can upload files to the cloud from your local computer. Use the Upload
button. The upper field in the dialog box navigates you through the file system on Jupyterlab. The Browse…
button will take you to your local file system.
You can only upload one file at a time. If you need to upload several files or a folder, you have to pack them into a .zip
file. Jupyterlab RStudio will automatically unzip it.
5 Download from Jupyterlab RStudio to your computer
Check the file(s) on Jupyterlab in the explorer. Hit the More
menu (the one with the gear icon) and select Export...
. If you have selected more than one file, RStudio will export the batch as a zip file.
6 Move and Copy files in your RStudio
7 ATRIUM_RESOURCES symlink
Shortcut to teacher’s folder
you can read and copy all files
you cannot delete them or edit them
To edit, save outside this folder.
A symlink is the most convenient way for you to access teacher’s folder. It is a folder in your home (created by the IT admin) that mirrors the corresponding folder in teacher’s home. When you open a file that the teacher is just working with, you can follow with the changes almost in real time. Every time the teacher saves the file and you refresh the view in the browser, you will see the latest changes.
8 Read other students’ RStudio folders
Students and teachers can read each others’ folders and copy from them.
Details at the end of this presentation.
To copy files from others, you need to be familiar with the file system and how it works. Maybe you will not need it at all, so I will postpone this topic to the very end of this tutorial.
9 Download teaching materials from GitHub
GitHub ≈ GoogleDrive for programmers
Files and folders in a dedicated repository
powered by a tool called Git
change tracking, sharing management
complex programmatic commands
Without Git: Download a repository or file to your PC
you only get the current snapshot
Go to the repository URL
use GitHub’s web GUI
Should symlink not be available for you, download the teaching materials from GitHub.
I store all my teaching materials in a GitHub repository for backup and access from different computers. You can download everything from there without bothering about the Git commands. But note that this ordinary download is but a snapshot and will not reflect future changes in the original.
11 Download a folder from GitHub
GitHub GUI Download works only for a file or a repository.
Use this web service to download a folder:
https://download-directory.github.io/?url=https://github.com/
THE_NAME_OF_THE_REPO/tree/main/
THE_NAME_OF_THE_FOLDER
Fortunately for us, there is a web service named download-directory.github.io
and you can use it simply by opening your browser and typing in a URL containing its name and the path to the target folder.
The URL of each GitHub repository ends with a suffix
.git
. Do not include this suffix.GitHub imposes some additional structure on the folders. Include
/tree/
after the repository name, followed by another internal “folder name”. This would typically bemain
.main
is the default name given by GitHub, but the repository owner could have renamed it.
12 Download folders with download-directory.github.io
download-directory.github.io
13 UFAL Linux Network
must-know if you
want to copy directly from teacher’s or students’ folders
get lost by inadvertently clicking on something in the
Files
tab.
/
is the top of the file system. Thehome
folder contains home folders of all users.
Do not make this a big deal because you will probably not use Jupyterlab RStudio in your personal work setup. But you could benefit from a basic orientation in the system during this course.
Jupyterlab is installed on a computational grid called AIC (Artificial Intelligence Cluster).
14 Alternative paths to your home
/home/YOURLOGIN
/lnet/aic/personal/YOURLOGIN
Do not ponder on it. It’s how the IT admin organized the file system.
15 Copy from someone’s home to yours - Step 1
/home/
YOUR_COLLEAGUE’S_FOLDER16 Copy from someone’s home to yours - Step 2
17 Copy from someone’s home to yours - Step 3
~/
FOLDER_NAME.18 Copy from someone’s home to yours - Step 4
Note that you are still in your colleague’s folder.
The file went ahead of you!