Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleAccessing JupyterHub server

The JupyterHub server at jupyter.math.uwaterloo.ca is available to students for use in courses where they need to access a Jupyter Notebook environment. No extra software is needed beyond your web browser.

  1. You can access the server by visiting https://jupyter.math.uwaterloo.ca.

  2. Log in with your WatIAM ID and password and click Sign In

    Image RemovedImage Added

    It will take a moment for your environment to start up. If this is the first time you have accessed the environment you will be presented with the Launcher.


The tiles in the Launcher provide access to a variety of computing and programming environments. You can use any of these environments, but only for coursework. Refer to the University's policies on computer usage for more information about appropriate usage.

...

Expand
titleFile Storage

You can see a list of directories available to you in the file browser in the left-hand panel.

Image RemovedImage Added

The directory shown in the screenshot above is your home directory on the server. Double-click the file that starts with !ALERT and a new tab will open with this text file. Please read this file. It explains that content in your home directory on the server could be deleted without notice and is not backed up.

  • In your home directory is a folder called _NetHome. This folder refers to your N: drive and is where you should store your coursework. Double-click the _NetHome item in the file browser to see the contents of your N: drive. You should put your course files on your N: drive to be able to access them here.

  • For Environment students, follow the instructions to map your N: drive. For students from other faculties, consult with your faculty's computing unit.

  • It is up to you to ensure you make copies of the files you need on the server. You can add files to your home directory on the server by clicking the Upload button:

    Image Added

    You can download files by right-clicking them and choosing Download.


    Expand
    titleRunning your own Jupyter Notebook environment

    Using Anaconda Navigator

    The easiest way to set up JupyterLab to run on your own computer for this course is to use Anaconda.

    1. Install Anaconda for your platform

    2. Open Anaconda Navigator

    3. Create a new Environment to store your work

      1. On the left, click Environments

      2. Click Create

      3. Give your new environment a name (environment name) and choose to include R

      4. Click Create. It may take a while for your environment to appear.

    4. With your new environment active click Home on the left

    5. Click Install under JupyterLab

    6. Click Launch under JupyterLab

    Using Command Line and Miniconda

    1. Open a terminal/powershell window

    2. Create your environment with these commands$ conda create -n environment name $ conda activate environment name

    (environment name) $ conda install -c conda-forge r-base r-essentials(environment name) $ conda install -c conda-forge jupyterlab(environment name) $ Rscript.exe
    1. commands (The $ represents the command prompt for your shell)

    	$ conda create -n environment name $ conda activate environment name
    (environment name) $ conda install -c conda-forge r-base r-essentials
    (environment name) $ conda install -c conda-forge jupyterlab
    (environment name) $ Rscript.exe pkg-list.R
    (environment name) $ jupyter lab


    Expand
    titleUsing a Jupyter Notebook

    Jupyter notebooks are divided into cells. Cells can contain code, or they can contain explanatory text/documentation.

    Code Cells

    Cells that contain code can be edited by clicking in them. And when selected they can be run in a few different ways:

    1. Clicking the Run button on the toolbar

    2. Clicking Run > Run Selected Cells on the main menu bar

    3. By pressing Shift+Enter on your keyboard

    In all cases, after you run a cell, any output from the code within the cell will be shown below the cell.

    If the code produces warnings or errors, they are shown below the cell in red.

    Documentation Cells


    When a cell contains explanatory text rather than code, it is generally stored in a text format called Markdown. When you edit these cells, you are editing plain text.
    When you run a cell with Markdown in it like this:

    It produces nicely formatted text like this:

    ...