News for hackers. Stuff that matters.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by klmr on Wednesday October 31, 2018 @06:47AM (#18344609)
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.

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by minimaxir on Wednesday October 31, 2018 @10:25AM (#18345935)
OP here:

Fair counterpoint, although when I wrote that I was more referring to the HTML knitting (via knitr). Also, there's a few very-new VS Code plugins for R Markdown which look very very interesting. (https://marketplace.visualstudio.com/items?itemName=neuron.n...)

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by gtycomb on Wednesday October 31, 2018 @09:52AM (#18345660)
After I used ESS with Emacs starting many years ago, I haven't opened RStudio. I know RStudio is very very nice, and ESS is a very complete option too.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by babahoyo on Wednesday October 31, 2018 @08:40AM (#18345147)
But the nice interactivity of it is only in RStudio iirc, which is a major selling point.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by klmr on Wednesday October 31, 2018 @09:24AM (#18345416)
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.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by laichzeit0 on Wednesday October 31, 2018 @01:34AM (#18343575)
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”.

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by vhhn on Wednesday October 31, 2018 @03:47AM (#18343950)
Also vim editing is restricted to editor window in the current session. So you can't paste from registers in console or in other RStudio sessions.

But its still much better experience to use RStudio markdown than Jupyter for me.

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by shreyansh_k on Wednesday October 31, 2018 @02:35PM (#18348174)
Hi, Which plugin do you use for Vim binding in Jupyter?
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by laichzeit0 on Thursday November 01, 2018 @01:47AM (#18351700)
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by closed on Wednesday October 31, 2018 @12:47AM (#18343434)
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...

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by nerdponx on Wednesday October 31, 2018 @03:33AM (#18343910)
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.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by cauthon on Wednesday October 31, 2018 @10:19AM (#18345874)
What would be the equivalent package for Julia?
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by nerdponx on Wednesday October 31, 2018 @11:12AM (#18346334)
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.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by ChrisRackauckas on Wednesday October 31, 2018 @10:26AM (#18345945)
Weave.jl
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by minimaxir on Wednesday October 31, 2018 @10:27AM (#18345953)
OP here:

reticulate isn't native to R Studio yet (it's in the insider build), but will be interesting to see what happens with adoption then.

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by cauthon on Wednesday October 31, 2018 @10:17AM (#18345864)
Is there an equivalent library for Julia?
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by peatmoss on Wednesday October 31, 2018 @12:26AM (#18343354)
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.

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by kryptiskt on Wednesday October 31, 2018 @06:42AM (#18344583)
I think it's likely R was inspired more by Mathematica's venerable notebook interface.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by klmr on Wednesday October 31, 2018 @06:58AM (#18344659)
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

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by radmuzom on Wednesday October 31, 2018 @12:46AM (#18343429)
A really good article on notebooks is the blog post by Yihui Xie - https://yihui.name/en/2018/09/notebook-war/.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by usgroup on Wednesday October 31, 2018 @02:54AM (#18343793)
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.

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by j88439h84 on Wednesday October 31, 2018 @03:51AM (#18343965)
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by SEJeff on Wednesday October 31, 2018 @10:27AM (#18345948)
Primary disadvantage of using R Notebooks Instead of Jupyter Notebooks: Writing R instead of numpy / pandas python.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by gtycomb on Wednesday October 31, 2018 @11:17AM (#18346379)
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.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by okket on Wednesday October 31, 2018 @03:06AM (#18343824)
Previous discussion from a year ago: https://news.ycombinator.com/item?id=14522795 (70 comments)
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by Myrmornis on Wednesday October 31, 2018 @10:36AM (#18346015)
Does anyone know why the ipython developers rejected solutions in which version control diffs were readable?
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by jabble on Wednesday October 31, 2018 @09:17AM (#18345374)
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
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by gaius on Wednesday October 31, 2018 @02:49AM (#18343773)
Working in RMarkdown it is super-easy to generate a publishable document from your research. Whereas there is still no good Jupyter—>PDF solution.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by pred_ on Wednesday October 31, 2018 @03:09AM (#18343831)
What's wrong with nbconvert?
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by gaius on Wednesday October 31, 2018 @03:21AM (#18343875)
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.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by jhbadger on Wednesday October 31, 2018 @10:02AM (#18345746)
In theory, because you can access LaTeX features from an R Notebook, you could even write an entire manuscript with it, although I don't know if anyone has.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by stephengillie on Wednesday October 31, 2018 @12:18AM (#18343321)
Bit of a typo in the title. Original: Advantages of Using R Notebooks For Data Analysis Instead of Jupyter Notebooks
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by scoot_718 on Wednesday October 31, 2018 @02:36AM (#18343738)
* You get enjoy a language with incompatible interfaces for every single data structure.

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

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by dang on Wednesday October 31, 2018 @12:36PM (#18347172)
Please don't take HN into programming language flamewars. Those are shallow, predictable, and usually nasty.

https://news.ycombinator.com/newsguidelines.html

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by scoot_718 on Thursday November 01, 2018 @05:02AM (#18352240)
Then you should delete the submitted article.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by nerdponx on Wednesday October 31, 2018 @03:31AM (#18343905)
Are you complaining about R or R Markdown? Because neither assertion is true for either language.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by mike_ivanov on Wednesday October 31, 2018 @03:06AM (#18343827)
That sounds kind of ..uhmm.. incoherent. Care to elaborate?
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by laingc on Wednesday October 31, 2018 @04:10AM (#18344026)
If you’ve used both R and another, more reasonable language for any length of time, it’s perfectly coherent.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by mike_ivanov on Wednesday October 31, 2018 @05:42AM (#18344343)
I'm using both R and Python on a daily basis (plus -- occasionally -- Clojure, Java and CL). Still, I don't understand what you mean.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by gaius on Wednesday October 31, 2018 @04:28AM (#18344062)
In the Tidyverse everything in R is perfectly logical and coherent. What would you consider to be a “reasonable” language then?
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by nerdponx on Wednesday October 31, 2018 @09:04AM (#18345289)
Base R is also perfectly logical and coherent. If anything, it's so coherent for statistics work that it makes non-statistics work harder than it should be. For a 30-year old language that started life as a statistics package, that's pretty good.

R is no harder to read than C IMO, even badly-written R without spaces, indentation, proper line breaks, etc.

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by mangecoeur on Wednesday October 31, 2018 @04:45AM (#18344100)
One where it was not necessary to specially create a ‘tidy’ version of everything to escape the horrific mess that exists by default
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by ryanmonroe on Wednesday October 31, 2018 @08:59AM (#18345261)
It would help if you said explicitly what language you think is better in this respect. Having Data Frames in Python at all requires importing Pandas afaik, so criticizing R for requiring an extra data-manipulation package wouldn't make sense from a Python perspective.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by mangecoeur on Wednesday October 31, 2018 @10:06AM (#18345781)
The point is not that you have to import a package, but whether by default package layouts and interop make sense. Notably, python scientific libraries build on a set of common foundations and apis (numpy, pandas etc). Additions to the ecosystem aim to build on familiar apis irrespective of implementation details (e.g dask). Python’s heavy use of namespaces makes organising a working environment simple, while it’s focus on consistent style and naming conventions means that code from different sources will look familiar. R meanwhile uses a global namespace (with at least two ways of loading libraries into it) so requiring more than a few extra libraries risks name collisions. Thus the need to create another ‘tidy’ library to fix a fundamental limitation of the language.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by mike_ivanov on Wednesday October 31, 2018 @01:52PM (#18347820)
> R meanwhile uses a global namespace

This is just plain wrong.

Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by mike_ivanov on Wednesday October 31, 2018 @05:45AM (#18344354)
OK, I see. The debate is gradually coming to the pitchforks and torches phase. Tons of adjectives and still zero meaningful input. I insist on explaining what the "horrific mess" part is about.
Re:Advantages of Using R Notebooks Instead of Jupyter Notebo... by gaius on Wednesday October 31, 2018 @06:32AM (#18344536)
Your language was perfect the day it was created was it? R and it’s ecosystem stand head and shoulders above the rest.