[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] very long table calc expressions ?
From: |
Uwe Brauer |
Subject: |
Re: [O] very long table calc expressions ? |
Date: |
Wed, 20 Jun 2018 11:09:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> Le 19/06/2018 19:21, Uwe Brauer a écrit :
> You may want to take a look at the orgtbl-aggregate package available on
> Melpa.
> #+BEGIN: aggregate :table "data" :cols "'Cual 1' count()"
> | 'Cual 1' | count() |
> |----------+---------|
> | NT | 3 |
> | MH | 2 |
> | AP | 5 |
> | SS | 1 |
> | NP | 3 |
> | SB | 1 |
> #+END:
> It features the count() function which computes frequency, but also sum,
> mean, filtering and much more.
> Documentation here: https://github.com/tbanel/orgaggregate
Thanks very much. I have already installed that package but the example
presented in the documentation were too sophisticated for my purpose. May
I suggest to include this example in the documentation, because your
package is a real time saver!!
I take the opportunity to ask whether your package can also easily
deal with the following problem (which is very important to me and
drives my crazy)
Take the following table
#+TBLNAME: raw-data
| Test |
|------|
| 0 |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| |
| |
| |
Important are the last three empty strings.
I know, thanks to the
https://orgmode.org/worg/org-tutorials/org-lookups.html
how to count the frequencies of the numbers in the column in an interval using
the
function
#+TBLNAME: stat-table
#+ATTR_HTML: :border 2 :rules all :frame border
| | lower bound | upper bound | frequency |
|----+-------------+-------------+-----------|
| NP | 0 | 0 | 1 |
| SS | 0 | 4.9 | 5 |
| AP | 5 | 6.9 | 2 |
| NT | 7 | 8.9 | 2 |
| SB | 9 | 10 | 1 |
#+TBLFM: $4='(length (org-lookup-all '($2 $3) '(remote(raw-data,@2$1..@>$1))
nil 'in-interval));N
#+BEGIN_SRC emacs-lisp
(defun in-interval (bounds el)
(and (>= el (car bounds)) (<= el (cadr bounds))))
#+END_SRC
However that function can not deal with empty strings (I could replace
the empty string by some string but then the function does not
distinguish between the string and 0). So I want that the entry NP
represents the counts of the empty strings: there are three in that column.
So can your package deal with this situation?
Thanks again
Uwe Brauer
smime.p7s
Description: S/MIME cryptographic signature
- [O] very long table calc expressions ?, Uwe Brauer, 2018/06/19
- Re: [O] very long table calc expressions ?, Thierry Banel, 2018/06/20
- Re: [O] very long table calc expressions ?,
Uwe Brauer <=
- Re: [O] very long table calc expressions ?, Bernt Hansen, 2018/06/21
- Re: [O] very long table calc expressions ?, Uwe Brauer, 2018/06/22
- Re: [O] very long table calc expressions ?, Bernt Hansen, 2018/06/22
- Re: [O] very long table calc expressions ?, Uwe Brauer, 2018/06/22
- Re: [O] very long table calc expressions ?, Jonathan Leech-Pepin, 2018/06/22
- Re: [O] very long table calc expressions ?, Uwe Brauer, 2018/06/22
- Re: [O] very long table calc expressions ?, Nick Dokos, 2018/06/22
- Re: [O] very long table calc expressions ?, Thierry Banel, 2018/06/22