emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Simplifying multiple "var" parameters for a code block
@ 2018-08-01 16:24 William Denton
  0 siblings, 0 replies; only message in thread
From: William Denton @ 2018-08-01 16:24 UTC (permalink / raw)
  To: emacs-orgmode

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-01 16:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 16:24 Simplifying multiple "var" parameters for a code block William Denton

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).