emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thierry Banel <tbanelwebmin@free.fr>
To: emacs-orgmode@gnu.org
Subject: orgtbl-aggregate on Melpa
Date: Tue, 11 Nov 2014 12:26:36 +0100	[thread overview]
Message-ID: <5461F26C.7030408@free.fr> (raw)

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

             reply	other threads:[~2014-11-11 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11 11:26 Thierry Banel [this message]
2014-11-11 13:44 ` orgtbl-aggregate on Melpa Eric S Fraga
2014-11-11 14:03   ` Rasmus
2014-11-11 18:33   ` Thierry Banel

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=5461F26C.7030408@free.fr \
    --to=tbanelwebmin@free.fr \
    --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).