[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing a variable into an R source block.
From: |
Berry, Charles |
Subject: |
Re: Passing a variable into an R source block. |
Date: |
Fri, 28 May 2021 17:30:09 +0000 |
> On May 28, 2021, at 8:52 AM, Roger Mason <rmason@mun.ca> wrote:
>
> Hello,
>
> I have an SQL source block that returns this:
>
> #+RESULTS: query
>
>
[snip]
> I would like to pass this into R for further processing. At the moment
> I have this:
>
> #+begin_src R :session :colnames yes :var data=query
> r <- data.frame($data)
[snip]
data.frame($data) is not valid R syntax. If you are new to R doing some
tutorials will help.
I suggest you use C-c C-v C-v (org-babel-expand-src-block) to see what the R
code is and debug the result given in the the *Org Babel Preview...* buffer.
HTH,
Chuck