From: Achim Gratz <Stromeko@Nexgo.DE>
To: emacs-orgmode@gnu.org
Subject: Re: calculate frequencies in a table with calc
Date: Wed, 26 Dec 2012 09:28:55 +0100 [thread overview]
Message-ID: <kbecft$a5$1@ger.gmane.org> (raw)
In-Reply-To: <CAJkULmn6Xw9dqS7huWoQPESCLOh3PavF=WnCWfbsaU7RoeugGQ@mail.gmail.com>
Am 25.12.2012 13:59, schrieb Martin Gross:
> #+TBLFM: @5$1=vcount(@I..@II)::@6$1=vcount(map(<if(eq(#1,12),1,[])>,@I..@II))
>
> With the first formula (@5$1) everything inside and outside the
> brackets is counted, but with the second (@6$1), where I am asking for
> the frequency of 12, only what is outside the brackets is considered.
> How could I also include what is inside the brackets, so I get 4?
The Calc manual tells you that vcount flattens nested vectors, vmap doesn't.
Try @6$1=vcount(map(<if(eq(#1,12),1,[])>,vflat(@I..@II)))
for the second formula.
--
Achim.
(on the road :-)
next prev parent reply other threads:[~2012-12-26 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-25 12:59 calculate frequencies in a table with calc Martin Gross
2012-12-26 8:28 ` Achim Gratz [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-12-27 8:57 Martin Gross
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='kbecft$a5$1@ger.gmane.org' \
--to=stromeko@nexgo.de \
--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).