emacs-orgmode
[Top][All Lists]
Advanced

[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: Grant Rettke
Subject: Re: [O] Error Embedding SQL Source from code block into R Source of Another (noweb)
Date: Tue, 30 Sep 2014 08:36:32 -0500

On Tue, Sep 30, 2014 at 3:05 AM, Rainer M Krug <address@hidden> wrote:
> Eric Brown <address@hidden> writes:

Like Rainier mentioned you might want to use [noweb] to tangle both
for output tangling and execution. My system is set up to tangle for
both eg:

This
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
#+name: query
#+begin_src sql
select
    *
from
    table
where
    x > 10
#+end_src

#+begin_src R :tangle output.R
input <- '
    «query»
'
#+end_src
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
produces this
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
input <- '
    select
        *
    from
        table
    where
        x > 10
'
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
and

this
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
#+name: msg
#+begin_src sql
Hello, world.
#+end_src

#+begin_src R :eval yes
print("«msg»")
#+end_src

#+NAME:
#+begin_example
[1] "Hello, world."
#+end_example
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

produces this

## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
╭────
│ Hello, world.
╰────

╭────
│ print("«msg»")
╰────

╭────
│ [1] "Hello, world."
╰────
## ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

http://orgmode.org/manual/noweb.html#noweb

reply via email to

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