emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* orgtbl-aggregate on Melpa
@ 2014-11-11 11:26 Thierry Banel
  2014-11-11 13:44 ` Eric S Fraga
  0 siblings, 1 reply; 4+ messages in thread
From: Thierry Banel @ 2014-11-11 11:26 UTC (permalink / raw)
  To: emacs-orgmode

Hi The List

My orgtbl-aggregate package is now available on MELPA.

It creates an aggragated Org table out of a source table.
Example: here are the 15 largest rivers in the World
(source: Wikipedia "List_of_rivers_by_length").

#+tblname: rivers
| River                          | Continent    | Length | Discharge |
|--------------------------------+--------------+--------+-----------|
| Nile-Kagera                    | Africa       |   6853 |      5100 |
| Amazon-Ucayali-Apurímac        | SouthAmerica |   6400 |    219000 |
| Yangtze (Chang Jiang)          | Asia         |   6415 |     31900 |
| Mississippi–Missouri–Jefferson | NorthAmerica |   6275 |     16200 |
| Yenisei-Angara-Selenge         | Asia         |   5539 |     19600 |
| Yellow River (Huang He)        | Asia         |   5464 |      2110 |
| Ob-Irtysh                      | Asia         |   5410 |     12800 |
| Paraná-Río de la Plata         | SouthAmerica |   4880 |     18000 |
| Congo-Chambeshi (Zaïre)        | Africa       |   4700 |     41800 |
| Amur-Argun (Heilong Jiang)     | Asia         |   4444 |     11400 |
| Lena                           | Asia         |   4400 |     17100 |
| Mekong (Lancang Jiang)         | Asia         |   4350 |     16000 |
| Mackenzie-Slave-Peace-Finlay   | NorthAmerica |   4241 |     10300 |
| Niger                          | Africa       |   4200 |      9570 |
| Murray-Darling                 | Australia    |   3672 |       767 |

We want to aggregate them by continents, with counts, means, and max.
To do so type:
  M-x org-insert-dblock:aggregate
or:
  C-c C-x i

#+BEGIN: aggregate :table "rivers" :cols "Continent count() mean(Length)
max(Discharge)"
| Continent    | count() | mean(Length) | max(Discharge) |
|--------------+---------+--------------+----------------|
| Africa       |       3 |         5251 |          41800 |
| SouthAmerica |       2 |         5640 |         219000 |
| Asia         |       7 |         5146 |          31900 |
| NorthAmerica |       2 |         5258 |          16200 |
| Australia    |       1 |         3672 |            767 |
#+END:

Documentation here:
https://github.com/tbanel/orgaggregate/blob/master/README.org

---------
To enable MELPA, add those lines to your .emacs:
  (require 'package)
  (add-to-list 'package-archives '("melpa" .
"http://melpa.milkbox.net/packages/") t)
  (package-initialize)

Then browse more than 2000 available packages
(including the latest Org Mode and almost 80 Org-related packages)
by typing:
  M-x package-list-packages

---------
Comments welcome
Have fun
Thierry Banel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-11 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-11 11:26 orgtbl-aggregate on Melpa Thierry Banel
2014-11-11 13:44 ` Eric S Fraga
2014-11-11 14:03   ` Rasmus
2014-11-11 18:33   ` Thierry Banel

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