[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Error Embedding SQL Source from code block into R Source of Anot

From: Charles Berry
Subject: Re: [O] Error Embedding SQL Source from code block into R Source of Another (noweb)
Date: Tue, 30 Sep 2014 15:08:36 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Brown <brown <at> fastmail.fm> writes:

> Dear List:
> It is possible to embed SQL code as a string to be evaluated in R. I am
> interested in formatting the SQL code in its own source code block, with
> its own syntax highlighting and editing mode (C-c ').
> The first time I run the code, I am prompted for R starting directory,
> but I get an error:
> ---
> load ESSR: + + + Error: unexpected string constant in:
> source('~/.emacs.d/elpa/ess-20140913.1153/etc/ESSR/R/.load.R',
> local=TRUE) #define load.ESSR
> load.ESSR('"
> ---
> and the console locks.  I can C-g to get out of it, and then
> re-evaluate, and the code prints what I expect -- the text of the SQL
> command.

[rest deleted]

Hmmm. Maybe the bug that was fixed by commit


about two weeks back? Make sure ob-R.el is up to date and compiled (or
that ob-R.elc is deleted).

Anyway, your code works as expected for me - first time.


FWIW, I prefer to use :var headers to import strings, but it takes some

--8<---------------cut here---------------start------------->8---

#+BEGIN_SRC emacs-lisp
  (defun grab-src (name)
      (org-babel-goto-named-src-block name)
      (nth 1 (org-babel-get-src-block-info 'light))))

#+BEGIN_SRC R :var y=(grab-src "sqlsource") :results output :exports both

: [1] "select \n  * \nfrom \n  t \nlimit \n  10"

--8<---------------cut here---------------end--------------->8---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]