emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Andrews <kyle.c.andrews@gmail.com>
To: Jack Kamm <jackkamm@gmail.com>
Cc: Emacs orgmode <emacs-orgmode@gnu.org>
Subject: Re: [RFC] ob-reticulate: R+Python interface from Babel
Date: Tue, 25 Aug 2020 19:34:08 -0400	[thread overview]
Message-ID: <CAG3md+tp6ji-5Rv4eAMBek878Ow-=QCB4XhbzUHxr9W_sLEeVw@mail.gmail.com> (raw)
In-Reply-To: <875z98gj4f.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]

Hi Jack,

As a frequent reticulate user I am very excited to see this patch. I hope
others feel the same and it gets included into org mode as I cannot wait to
use it.

Best Regards,

On Mon, Aug 24, 2020, 11:28 Jack Kamm <jackkamm@gmail.com> wrote:

> Hi all,
> Reticulate is an R package for interfacing between R and Python. It allows
> accessing objects in a Python session from R and vice versa. See
> https://rstudio.github.io/reticulate/ for more info about it.
> I've written a small patch for using reticulate from org-babel. It allows
> creating a source block of lang "reticulate", which behaves as Python for
> font highlighting and editing, but is executed in an R session via
> reticulate.
> I'm wondering whether this should go into org-mode, or whether to package
> this separately. I'm also curious whether this would be useful to anyone
> here. Any feedback is appreciated.
> The main advantage of reticulate is being able to access Python objects
> directly from R and vice versa, without having to write them to a separate
> file or pass them through the ":var" header argument. For example, we could
> do the following:
> #+begin_src reticulate :session
>   import pandas as pd
>   fib = [0, 1]
>   for _ in range(10):
>       fib.append(fib[-1] + fib[-2])
>   df = pd.DataFrame({
>       "i": list(range(len(fib))),
>       "F_i": fib
>   })
> #+end_src
> #+begin_src R :session :results graphics value file :file fig.png
>   library(reticulate)
>   with(py$df, plot(i, F_i))
> #+end_src
> Reticulate source blocks support both "value" and "output" results, and
> even supports graphics with matplotlib. It's primarily intended to be used
> in sessions, and the ":session" header argument should match between
> reticulate and R source blocks.
> Cheers,
> Jack

[-- Attachment #2: Type: text/html, Size: 2465 bytes --]

  reply	other threads:[~2020-08-25 23:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 15:26 [RFC] ob-reticulate: R+Python interface from Babel Jack Kamm
2020-08-25 23:34 ` Kyle Andrews [this message]
2020-08-29 13:23 ` Kyle Meyer
2020-09-04  7:14   ` Bastien
2020-10-12  4:15 ` Jack Kamm
2021-02-27 14:15   ` Jack Kamm
2021-02-27 17:24     ` Jeremie Juste
2021-03-02 23:52       ` Jack Kamm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG3md+tp6ji-5Rv4eAMBek878Ow-=QCB4XhbzUHxr9W_sLEeVw@mail.gmail.com' \
    --to=kyle.c.andrews@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jackkamm@gmail.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).