From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: orgmode and R? Date: Mon, 03 Aug 2015 13:58:58 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMK0w-00056U-O6 for emacs-orgmode@gnu.org; Mon, 03 Aug 2015 13:59:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMK0s-00071f-Qq for emacs-orgmode@gnu.org; Mon, 03 Aug 2015 13:59:06 -0400 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:36153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMK0s-00071V-Ma for emacs-orgmode@gnu.org; Mon, 03 Aug 2015 13:59:02 -0400 Received: by qkdv3 with SMTP id v3so53588771qkd.3 for ; Mon, 03 Aug 2015 10:59:02 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jude DaShiell Cc: emacs-orgmode@gnu.org I don't know much about R, but here is a hack to do somthing like this with python. I have not tested it beyond what you see here. You can use emacs lisp in an org-mode spreadsheet as a formula. We will hack that to let us use Python. We will do that by making a lisp function that evaluates a python string and returns the results. | x | y | | |---+---+----| | 1 | 2 | 3 | | 2 | 4 | 6 | | 3 | 6 | 18 | |---+---+----| | | | | #+TBLFM: @2$3=@2$1 + @2$2 #+TBLFM: @3$3='(+ @3$1 @3$2);N #+TBLFM: @4$3='(python "@4$1 * @4$2");N #+BEGIN_SRC emacs-lisp (defun python (string) "Send string to a python interpreter and return result." (python-shell-send-string-no-output string (or (python-shell-get-process) (run-python)))) #+END_SRC Jude DaShiell writes: > Can the orgmode spreadsheet access R either directly or indirectly through > maybe babel? If this is possible, do any tutorials exist with some worked > examples? I have R and emacs-R-mode installed so I can access R from > emacs at least. -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu