NEON EDUCATION bio photo

NEON EDUCATION

Devoted to open data and open source in science and education.

View All Tutorials

This tutorial is a part of a series!

Click below to view all lessons in the series!

Tags

R programming (52)
Hierarchical Data Formats (HDF5) (15)
Spatial Data & GIS (22)
LiDAR (10)
Raster Data (14)
Remote Sensing (24)
Data Visualization (4)
Hyperspectral Remote Sensing (17)
Time Series (15)
Phenology (7)
Vector Data (6)
Metadata (1)
Git & GitHub (7)
(1) (1) (13)

Tutorial by R Package

dplyr (7)
ggplot2 (16)
h5py (2)
lubridate (time series) (6)
maps (1)
maptools (1)
plyr (2)
raster (26)
rasterVis (raster time series) (3)
rgdal (GIS) (24)
rgeos (2)
rhdf5 (11)
sp (5)
scales (4)
gridExtra (4)
ggtheme (0)
grid (2)
reshape2 (3)
plotly (5)

View ALL Tutorial Series




Twitter Youtube Github


Blog.Roll

R Bloggers

Overview

In this tutorial we learn how to effectively and efficiently document and publish our workflows online.

Learning Objectives

At the end of this activity, you will be able to:

  • Explain why documenting and publishing one’s code is important.
  • Describe two tools that enable ease of publishing code & output: Jupyter Notebooks with the Python kernel.

Documentation Is Important

As we read in the Reproducible Science overview, the four facets of reproducible science are:

  • Documentation
  • Organization,
  • Automation and
  • Dissemination.

This week we will learn about the Jupyter Notebook as a tool to document and publish (disseminate) your code and code output.

View Slideshow: Share, Publish & Archive - from the Reproducible Science Curriculum

Jupyter Notebook

“The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, machine learning and much more.” – Jupyter Notebook documentation.

We use markdown syntax in Notebook documents to document workflows and to share data processing, analysis and visualization outputs. We can also use it to create documents that combine code in your language of choice, output and text.

The Jupyter Notebooks grew out of iPython. Jupyter is a close acronym meaning Julia, Python, and R. Which were the first languages outside Python that the Jupyter application was designed for. Jupyter Notebooks now support over 40 coding languages. You may still find some references to iPython in materials related to Jupyter Notebooks. This series will focus on using Jupyter Notebooks with Python, but the information presented can apply to other languages as well.

The Jupyter Notebooks application is a browser-based application. Therefore, you need an updated browser (the Jupyter people recommend Mozilla Firefox or Google Chrome, but not Microsoft Explorer). When installed on your computer you can always access the app even without internet access. You can also use Jupyter installed on a remote server. For example, Jupyter runs a training (temporary) server based version.

Why Jupyter Notebooks?

There are many advantages to using Jupyter Notebooks in your work:

  • Human readable syntax.
  • Simple syntax - it can be learned quickly.
  • All components of your work are clearly documented. You don’t have to remember what steps, assumptions, tests were used.
  • You can easily extend or refine analyses by modifying existing or adding new code blocks.
  • Analysis results can be disseminated in various formats including HTML, PDF, slide shows and more.
  • Code and data can be shared with a colleague to replicate the workflow.

Explore Example of Notebooks

Before we jump into how to work with notebooks, check out a few shared notebooks. As you look at these different notebooks, what aspects of the layout do you like, what don’t you like? Is there a place in your current workflow that these notebooks would be useful?

In the next tutorial we will learn more about working with Jupyter Notebooks.