* problem with frequency table if it contains strings.
@ 2018-06-18 10:10 Uwe Brauer
2018-06-19 17:19 ` Uwe Brauer
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Brauer @ 2018-06-18 10:10 UTC (permalink / raw)
To: emacs-orgmode
Hi
Please consider the following example
#+BEGIN_SRC emacs-lisp
(defun in-interval (bounds el)
(and (>= el (car bounds)) (<= el (cadr bounds))))
#+END_SRC
#+TBLNAME: raw-data
| Test |
|------|
| 0 |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| NP |
| NP |
| NP |
#+TBLNAME: stat-marco
#+ATTR_HTML: :border 2 :rules all :frame border
| | lower bound | upper bound | frequency |
|----+-------------+-------------+-----------|
| SS | 0 | 4.9 | 8 |
| 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
The result is incorrect this the function also counted the entries NP,
which should have been ignored.
That is a annoying and I would strongly appreciate any
clarification/help
Thanks
Uwe Brauer
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: problem with frequency table if it contains strings.
2018-06-18 10:10 problem with frequency table if it contains strings Uwe Brauer
@ 2018-06-19 17:19 ` Uwe Brauer
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Brauer @ 2018-06-19 17:19 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 575 bytes --]
>>> "Uwe" == Uwe Brauer <oub@mat.ucm.es> writes:
> | | lower bound | upper bound | frequency |
> |----+-------------+-------------+-----------|
> | SS | 0 | 4.9 | 8 |
> | 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
It is the evil N option, but I don't see how to substitute it.
Any ideas?
Uwe Brauer
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-19 17:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-18 10:10 problem with frequency table if it contains strings Uwe Brauer
2018-06-19 17:19 ` Uwe Brauer
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.