[Top][All Lists]

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

[O] [Babel][R] Inclusion of multi-line named code blocks in R code

From: Alexander Vorobiev
Subject: [O] [Babel][R] Inclusion of multi-line named code blocks in R code
Date: Wed, 18 Sep 2013 16:51:26 -0500

I have R code which submits SQL statements to a database server. Since the SQL is rather complex, I want to put it into a separate code block in order to have proper formatting, syntax highlighting, etc:

#+name: long-sql
#+begin_src sql
    select * 
    from many, tables
        complex_condition1 = 1,
        complex_condition2 = 2

* Load the data to R session
#+begin_src R :session *R* :noweb yes
    result <- submit_query('<<long-sql>>')

Unfortunately, the R block doesn't work. When I open the file generated by Babel, I see this:

result <- submit_query('select *
result <- submit_query('from many, tables

instead of the one R submit_query call with my SQL statement as an argument. Is there anything I can do to achieve that?


reply via email to

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