emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: "Christopher W. Ryan" <cryan@binghamton.edu>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Babel problem (was how do scientists use org mode?)
Date: Thu, 02 Feb 2012 15:12:51 -0500	[thread overview]
Message-ID: <14326.1328213571@alphaville> (raw)
In-Reply-To: Message from "Christopher W. Ryan" <cryan@binghamton.edu> of "Thu, 02 Feb 2012 13:59:03 EST." <4F2ADCF7.9070402@binghamton.edu>

Christopher W. Ryan <cryan@binghamton.edu> wrote:

> John and Nick--
> 
> The question about whether I have python on my machine is not silly--I
> am. Got so carried away I forgot I was on my work computer, which indeed
> does not have python. But I do have R and perl, and similar code blocks
> in either language yield the same problem, so I'll just focus on them as
> examples (he said, sheepishly.)
> 
> I usually interface with R via emacs ESS. Currently ESS is using R
> version 2.11.1.
> 
> R executable is in C:\Program Files\R\R-2.11.1\bin
> 
> I usually interface with perl via another text editor, Programmer's
> Notepad, set up with drop-down menu item to execute the file in perl.
> 
> Perl executable is in C:\strawberry\perl\bin
> 
> C:\Org\org-7.7\lisp contains, among others, files called ob-R.el and
> ob-perl.el
> 
> Currently my path variable looks like this:
> 
> Files\QuickTime\QTSystem\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Xpdf;C:\strawberry\perl\bin;C:\strawberry\c\bin;C:\strawberry\perl\site\bin
> 
> 
> My .emacs now contains:
> 
> ;; active Babel languages
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((R . t)
>    (python . t)
>    (perl . t)
>    ))
> 
> 
> As to Nick's questions,
> 
> M-x locate-library RET ob-R RET
> 
> tells me ob-R is located in C:\Org\org-7.7\lisp\ob-R.el
> 
> M-: to evaluate (require 'ob-R.el)
> 
> yields ob-R in the minibuffer
> 
> Then C-c C-c in the R code block yields
> 
> Code block produced not output.
> 
> in the minibuffer,
> 
> and a new buffer that says,
> 
> 'R' is not recognized as an internal or external command,
> operable program or batch file.
> 

It's probably a path issue as you surmise below.

ob-R.el includes the following:

(defvar org-babel-R-command "R --slave --no-save"
  "Name of command to use for executing R code.")

Try setting something like

(setq org-bable-R-command "/full/path/to/R --slave --no-save")

in your .emacs, although the exact format for Windows is going to 
be different. This is meant as a test, not as a fix: if that works,
then you can figure out how to change your path and get rid of the
hack.

> 
> I tried evaluating (require 'ob-perl) and this yielded
> 
> ob-perl
> 
> in the minibuffer, and thereafter the perl code block executed properly.
> 

Ok, that's promising.

> I wonder if I need to put the path to R in my PATH variable? (come to
> think of it, don't know why it's not already there); its absence has so
> far not prevented me from using R via ESS.
> 

Probably.

Nick

      reply	other threads:[~2012-02-02 20:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 17:27 Babel problem (was how do scientists use org mode?) John Hendy
2012-02-02 18:59 ` Christopher W. Ryan
2012-02-02 20:12   ` Nick Dokos [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=14326.1328213571@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=cryan@binghamton.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).