
Advantages of Using R Notebooks Instead of Jupyter Notebooks (2017) - breckuh
https://minimaxir.com/2017/06/r-notebooks/
======
klmr
The article claims that

> _R Notebooks can only be created and edited in RStudio_

Luckily, this is _wrong_. Since R Notebooks are simply R Markdown, they can be
edited with _any_ editor (although the integration is obviously lost). This
is, in fact, one of its decisive advantages over Jupyter Notebooks: most of
the other issues mentioned in the article are solvable, whereas this issue
fundamentally isn’t.

~~~
babahoyo
But the nice interactivity of it is only in RStudio iirc, which is a major
selling point.

~~~
klmr
Yep, the RStudio integration is _very_ nice. However, there are other ways of
authoring R Notebooks that also allow interactivity, and the only thing that’s
missing then is having output _inline_ inside the editable document. Apart
from that, if you for example use Nvim-R or ESS, you can write R Markdown,
execute chunks selectively, and get a visual, interactive representation of
the results in real time that way. And once the document is done, a single
press of a button will render the resulting Markdown/HTML/PDF document.

------
laichzeit0
It’s just that RStudio’s vim support is so extremely bad, compared to VSCode
or even the Jupyter Notebook vim plug-in. I guess this won’t bother you if you
don’t have a developer background, but I find that editing code in RStudio is
a real pain.

I wish I could use RStudio with the exact same keybindings and vim behavior as
Jupyter in the browser. That alone would make things bearable. Like the exact
same keys for cell execution, adding new cells, etc. Call it “Jupyter mode”.

~~~
shreyansh_k
Hi, Which plugin do you use for Vim binding in Jupyter?

~~~
laichzeit0
[https://github.com/lambdalisue/jupyter-vim-
binding](https://github.com/lambdalisue/jupyter-vim-binding)

------
closed
RE python in Rmarkdown being limited...

> The Python session ends after the cell executes, making it unhelpful for
> tasks other than ad hoc scripts.

This isn't the case anymore thanks to the reticulate library.

[https://blog.rstudio.com/2018/03/26/reticulate-r-
interface-t...](https://blog.rstudio.com/2018/03/26/reticulate-r-interface-to-
python/)

~~~
nerdponx
Reticulate was a major improvement in the data science workflow. We now have
full interoperability between R, Python, and Julia (or Scala if you're on
Spark). The ability to mix languages is really valuable.

~~~
cauthon
What would be the equivalent package for Julia?

~~~
nerdponx
PyCall.jl can call Python from Julia. On the downside, it has a lot of
problems and there doesn't seem to be enough dev effort to match.

------
peatmoss
R notebooks behave similarly to org-mode, albeit with fewer supported
languages and a few less options for controlling execution and value passing
between code blocks. Org-mode is the oldest and most powerful environment of
this sort that I know of.

That said, for new users, I think R Notebooks are less daunting than Emacs +
org-mode.

Like most things associated with RStudio and the Tidyverse, I feel that
they’ve really done their homework. Even if org-mode does more, I feel it’s
pretty evident that R Notebooks at least made an effort to understand org-
mode’s prior art.

~~~
kryptiskt
I think it's likely R was inspired more by Mathematica's venerable notebook
interface.

~~~
klmr
It was obviously inspired by many different things but the most direct
genealogy is WEB [1] → noweb → Sweave → Knitr → R Markdown → R Notebooks.

Mathematica’s notebook interface in turn was almost certainly also inspired
(directly or indirectly) by WEB, given that this was the first literate
programming tool ever created.

[1] [https://en.wikipedia.org/wiki/WEB](https://en.wikipedia.org/wiki/WEB)

------
radmuzom
A really good article on notebooks is the blog post by Yihui Xie -
[https://yihui.name/en/2018/09/notebook-
war/](https://yihui.name/en/2018/09/notebook-war/).

------
usgroup
I’ve moved to Orgmode Babel for all my notebook needs. Work straight out of
emacs, exports to many formats, literate programming, supports dozens of
languages.

Previously used R notebooks exclusively for all the benefits author mentioned.

~~~
j88439h84
[https://github.com/gregsexton/ob-ipython](https://github.com/gregsexton/ob-
ipython) is good

------
gaius
Working in RMarkdown it is super-easy to generate a publishable document from
your research. Whereas there is still no good Jupyter—>PDF solution.

~~~
pred_
What's wrong with nbconvert?

~~~
gaius
It’s fine if you just want to show something to someone who for whatever
reason can’t run the notebook themselves, but it’s not up to producing a
“formal” document. Maybe in a few years it might be.

------
SEJeff
Primary disadvantage of using R Notebooks Instead of Jupyter Notebooks:
Writing R instead of numpy / pandas python.

~~~
gtycomb
R's tidyverse, along with the numerous R packages/documentation developed and
tested over a long period of time, are efficient too. Thankful to see both
Python and R thrive.

------
okket
Previous discussion from a year ago:
[https://news.ycombinator.com/item?id=14522795](https://news.ycombinator.com/item?id=14522795)
(70 comments)

------
Myrmornis
Does anyone know why the ipython developers rejected solutions in which
version control diffs were readable?

------
jabble
[https://atom.io/packages/hydrogen](https://atom.io/packages/hydrogen) \+ git
is a decent way to get jupyter interactivity and an easy to apply version
control on a plain python file

------
stephengillie
Bit of a typo in the title. Original: _Advantages of Using R Notebooks For_
Data Analysis _Instead of Jupyter Notebooks_

------
scoot_718
* You get enjoy a language with incompatible interfaces for every single data structure.

* Write-only language ensures your ideas are difficult to steal

~~~
dang
Please don't take HN into programming language flamewars. Those are shallow,
predictable, and usually nasty.

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

~~~
scoot_718
Then you should delete the submitted article.

