Copy instructor’s code/data to your home directory

If your instructor has uploaded code and/or data to the shared drive (this is the shared_data directory within your Home directory) then the first thing you should do before using these files is to copy them to your Home directory. These copies will serve as your own personal version of the files, which you can modify as you wish.

There are several different ways you can copy files from the shared_data directory to your Home directory, depending on whether you’d prefer to use the command line or a GUI. Here are the options:

RStudio

Using Terminal

  1. Click on the Terminal tab on the top left panel, next to Console.
  2. Copy the file(s) or directories you want from the shared_data directory to your home directory: cp -r shared_data/<file-or-directory-you-want>/ .

Using shell commands in the R console

  1. Copy the file(s) or directories you want from the shared_data directory to your home directory by running the following command in the console: system("cp -r ~/shared_data/<file-or-directory-you-want>/ .")

Using the File menu

  1. In the Files menu in the bottom right panel, navigate to the shared_data directory.
  2. Navigate to the directory with materials for the current session.
  3. Put a check next to the file you want to copy to your home folder. You can only copy one file at a time and cannot copy directories.
  4. Click on the More dropdown menu (with gears icon) and select Copy To.
  5. Near the top of the resulting pop-up window, click on the Home directory icon.
  6. Click the Save button on the bottom right. There will now be a copy of the file in your home directory, which you can open and work with.

Jupyter

Using Terminal

  1. Click on the New dropdown on the right side of the page.
  2. Select Terminal from the dropdown menu.

  1. A new browser tab will open. Copy the file(s) or directories you want from the shared_data directory to your home directory: cp -r shared_data/<file-or-directory-you-want>/ .

  1. Close the browser tab containing the Terminal (do not click logout!). Go back to the previous browser tab to access Jupyter again.

Using shell commands in cells

  1. Open an existing Jupyter Notebook or create a new notebook.

  1. In a new cell, copy the file(s) of interest to your home directory: !cp -r ~/shared_data/<file-or-directory-you-want>/ .

Using the File menu

  1. Navigate to the file of interest within the shared_data directory.
  2. Click Duplicate from the top menu.
  3. Select the radio button next to the duplicated file.
  4. Click Move from the top menu.
  5. Delete ALL of the file path in the pop-up window and click the blue Move button