From: William Denton <wtd@pobox.com>
To: emacs-orgmode@gnu.org
Subject: Simplifying multiple "var" parameters for a code block
Date: Wed, 1 Aug 2018 12:24:46 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.2.02.1808011207490.6310@shell.miskatonic.org> (raw)
Is there a way to pull data from multiple clocktables (with names matching a
regular expression) all at the same time into variables passed into a code
block?
I use clocktables to keep track of how I spend my time at work, with things
falling into one of three major categories (see [1]). I use a different
clocktable for every month, and they have names like c_201805, c_201806 and
c_201807. For example:
#+BEGIN: clocktable :maxlevel 3 :scope tree :compact nil :header "#+NAME: c_201808\n"
#+NAME: c_201808
[ ... clocktable stuff here ... ]
#+END
This all works very well but it leads to some messiness when I want to gather up
data from all of those clocktables at the same time. I use R to munge the data,
and I have a source block that starts:
#+BEGIN_SRC R :session R:clocktable :results none :var c_201709=c_201709
c_201710=c_201710 c_201711=c_201711 c_201712=c_201712 c_201801=c_201801
c_201802=c_201802 c_201803=c_201803 c_201804=c_201804 c_201805=c_201805
c_201806=c_201806 c_201807=c_201807 c_201808=c_201808 :colnames yes
When I just had three or four monthly clocktables to handle, that was OK, but as
you can see it's getting kind of crazy.
Is there a way that I can get all of the c_YYYYMM tables passed into a code
block, as done above, but without having to specify them individually? I have a
feeling there's a bit of Lisp that would do it somehow, but I don't know what it
would be. I'm happy to use an intermediary table if that's easiest.
Any suggestions would be most welcome.
Bill
[1] https://www.miskatonic.org/2017/11/16/clocktableii/
--
William Denton :: Toronto, Canada --- Listening to Art: https://listeningtoart.org/
https://www.miskatonic.org/ --- GHG.EARTH: http://ghg.earth/
Caveat lector. --- STAPLR: http://staplr.org/
reply other threads:[~2018-08-01 16:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=alpine.DEB.2.02.1808011207490.6310@shell.miskatonic.org \
--to=wtd@pobox.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).