KT strongly recommends using R markdown over Jupyter notebooks.
The main reasons for this recommendation are:
- Works easily with both
RandPython. git-friendly.- Does not require a browser.
- Can be edited in a good text editor instead of
RStudio. - Easier to convert to other formats, especially manuscripts for submission.
As always, there are exceptions to this rule!
KT likes Jupyter notebooks, and they are the best/only game in town for generating interactive Python graphics.
R Markdown is a "flavor" of markdown.
The way most people use R markdown is within RStudio.
Rstudio is an "integrated development environment", or IDE for the R programming language.
It differs from "vanilla" markdown is that you can execute R code display graphics generated via R.
With the reticulate package installed, you may also do the same with Python code.
More info on R markdown can be found in the section Generating content with R markdown on the main page.
- An
R markdowndocument is plain text, making itgit-friendly. - As it is a plain text format, you can use whatever editor you like.
- Works with both
RandPython - Can generate various output formats, including
HTMLandPDF. RStudiomakes a nice "one stop shop" for a project usingR.RStudiohasgitintegration!- The
R markdownformat can be the basis of slides, manuscripts, or books.
- Different "flavors" of
R markdownused for slides, books, etc., can have subtly different ways of doing specific things. - Documents are compiled from
markdownto the output format from top to bottom. Thus, it can take some time to reprocess a large document. RStudiois not straightforward to set up for remote work.
Jupyter lab is a browser-based notebook application that supports many different languages, including R and Python.
Its language agnosticism means that it is not an IDE for any language.
Rather, it is a nice application for entering text and code and making reports, slides, etc..
- Works with both
RandPython - Can generate various output formats, including
HTMLandPDF. - Individual code "cells" can be executed in isolation, so you don't necessarily have to reprocess the entire document.
- Can make very nice slides!
- The notebooks are binary files.
Thus, it is nearly impossible to see the differences between changes using
git/GitHub. There are workarounds for this problem, but they aren't as good as plain text. - Inconvenient for generating output in the right format to submit as a manuscript for publication.
- The browser requirement makes it difficult to use remotely. See here.