From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uwe Brauer Subject: problem with frequency table if it contains strings. Date: Mon, 18 Jun 2018 12:10:48 +0200 Message-ID: <87h8m05rrr.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUr7u-0005hj-2D for emacs-orgmode@gnu.org; Mon, 18 Jun 2018 06:11:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUr7p-0007GW-44 for emacs-orgmode@gnu.org; Mon, 18 Jun 2018 06:11:10 -0400 Received: from [195.159.176.226] (port=45388 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUr7o-0007GA-PA for emacs-orgmode@gnu.org; Mon, 18 Jun 2018 06:11:05 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fUr5a-0008To-MA for emacs-orgmode@gnu.org; Mon, 18 Jun 2018 12:08:46 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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