emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] problem with frequency table if it contains strings.


From: Uwe Brauer
Subject: [O] problem with frequency table if it contains strings.
Date: Mon, 18 Jun 2018 12:10:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]