emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Berry, Charles" via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
To: Roger Mason <rmason@mun.ca>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Passing a variable into an R source block.
Date: Fri, 28 May 2021 17:30:09 +0000	[thread overview]
Message-ID: <D9A24539-0E14-4AF5-B845-1DD73301A9A6@health.ucsd.edu> (raw)
In-Reply-To: <y658s3y4zzn.fsf@mun.ca>



> 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





  reply	other threads:[~2021-05-28 17:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 15:52 Roger Mason
2021-05-28 17:30 ` Berry, Charles via General discussions about Org-mode. [this message]
2021-05-29 14:13   ` Roger Mason
2021-05-28 19:29 ` William Denton

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=D9A24539-0E14-4AF5-B845-1DD73301A9A6@health.ucsd.edu \
    --to=emacs-orgmode@gnu.org \
    --cc=ccberry@health.ucsd.edu \
    --cc=rmason@mun.ca \
    --subject='Re: Passing a variable into an R source block.' \
    /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

Code repositories for project(s) associated with this 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).