From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: [babel] org mode tables and tangling
Date: Thu, 12 Jan 2012 19:42:23 +0100 [thread overview]
Message-ID: <871ur4yd80.fsf@med.uni-goettingen.de> (raw)
Hi all,
What is the suggested way to use org mode tables in connection with tangling?
Example: If I tangle this org mode file
/====<org-file>=====================================\
| * org-tables and reproducibility |
| #+name: params |
| | number | param | |
| |--------+-------| |
| | 0 | 1 | |
| | 1 | 1 | |
| |
| #+begin_src R :var params=params :tangle test.R |
| apply(params, 1, print) |
| #+end_src |
\====</org-file>====================================/
the tangled file looks like
/====<test.R>===============================================================\
| params <- read.table("/tmp/babel-19196cip/R-import-19196ILE", |
| header=TRUE, row.names=NULL, sep="\t", as.is=TRUE) |
| attach(params) |
| apply(params, 1, print) |
\====</test.R>==============================================================/
which depends on a temporary file. I could distribute that along with the
tangled file, of course.
But I'd like a distributable, ideally self-contained version, that my
co-workers can work with.
Something like this, maybe:
/====<sample.R>=======================================================\
| # generated with R dput()... |
| babel_tmp_1238h098 <- structure(list(means = 0:1, sds = c(1L, 1L)), |
| .Names = c("means", "sds"), |
| class = "data.frame", |
| row.names = c(NA, -2L)) |
| params <- dget(textConnection("babel_tmp_1238h098", "r")) |
\====</sample.R>======================================================/
Is such a mode of tangling already available for R?
Best,
Andreas
next reply other threads:[~2012-01-12 18:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 18:42 Andreas Leha [this message]
2012-01-14 17:55 ` [babel] org mode tables and tangling 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871ur4yd80.fsf@med.uni-goettingen.de \
--to=andreas.leha@med.uni-goettingen.de \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.