emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: emacs-orgmode@gnu.org
Subject: [Babel] Header arguments
Date: Fri, 13 May 2011 16:56:51 -1000	[thread overview]
Message-ID: <m1mxiqj8gc.fsf@tsdye.com> (raw)

Aloha all,

I have a little function that graphs two 14C dates (below).  The data
are held in tables produced by a software package that I access on the
web.  I read these into Org-mode and give them a #+tblname:, as shown
below.  I'd like to have one function that will graph any number of tables
but I don't know how to package up the table references and get them
inside the function.  If I put them in a table, they end up as strings
inside the function.

I suspect I'm being thick about this.  Can someone give me a pointer to
how this might be done?

All the best,
Tom

#+tblname: theta-one-no-rat
| cal BP | Posterior probability |
|--------+-----------------------|
|  -1520 | 1.8353001633417145E-5 |
...


**** Two dates
#+srcname: two-dated-events
#+header: :file ~/org/tsdye/two-dates.pdf
#+header: :var xlab="theta_1"
#+header: :var x=theta-one-no-rat 
#+header: :var ylab="theta_4"
#+header: :var y=theta-four-no-rat 
#+header:  :width 6 :height 4 :results output graphics
#+begin_src R 
  library(ggplot2)  
  res <- data.frame(cal.BP=numeric(0),Posterior.probability=numeric(0),label=character(0))
  res <- rbind(res,cbind(x,label=rep(xlab,dim(x)[1])))
  res <- rbind(res,cbind(y,label=rep(ylab,dim(y)[1])))
  theme_set(theme_bw(base_size=11))
  g <-  ggplot(res, aes(x=1950 + cal.BP, y=Posterior.probability))
  g + geom_bar(stat='identity') + xlab("Year AD") +
  ylab("Probability") + facet_wrap(~ label)
#+end_src

-- 
Thomas S. Dye
http://www.tsdye.com

             reply	other threads:[~2011-05-14  2:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-14  2:56 Thomas S. Dye [this message]
2011-05-14  4:04 ` [Babel] Header arguments Nick Dokos
2011-05-14 14:05 ` Eric Schulte

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=m1mxiqj8gc.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).