From: Jude DaShiell <jdashiel@panix.com>
To: Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: searching for csv utilities
Date: Wed, 3 Jun 2015 17:12:36 -0400 (EDT) [thread overview]
Message-ID: <alpine.NEB.2.11.1506031711400.29145@panix1.panix.com> (raw)
In-Reply-To: <CAEWDx5fd2YSm5MAomydJ8pZwXA+oR+xoe=tU_YroMeYTWif1JQ@mail.gmail.com>
Hi Jonathan,
calc has vmode if that helps any.
On Wed, 3 Jun 2015, Jonathan Leech-Pepin
wrote:
> Date: Wed, 3 Jun 2015 12:38:37
> From: Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
> To: Jude DaShiell <jdashiel@panix.com>
> Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
> Subject: Re: [O] searching for csv utilities
>
> On 3 June 2015 at 12:07, Jude DaShiell <jdashiel@panix.com> wrote:
>
>> This is a piece of a modified ecm that may show what's going on.
>>
>> cut here.
>> |----------------------+---------+--------+--------+--------|
>> | Averages: | | | | |
>> | Counts: | | | | |
>> | Maximums: | | | | |
>> | Medians: | | | | |
>> | Minimums: | | | | |
>> | Modes: | | | | |
>> | Standard Deviations: | | | | |
>> | Sums: | 108.69) | 70.45) | 66.62) | 92.93) |
>> |----------------------+---------+--------+--------+--------|
>> #+TBLFM: @>$2..@>$>=vmean(@I..@>>;%.2f)
>>
>> I haven't even attempted the rest of the math since I have no way to
>> predict where any of the results will land.
>>
>
> @> means last line, @>> is second to last, @>>> third to last and so on.
> So for 7th from the bottom it would be @>>>>>>>.
>
> Re: PrintF specification
> Everything after the =;= is considered part of the specification, so the
> =)= used to close the vmean is actually part of the specification.
> Changing that to =vmean();%.2f= will correct it.
>
>
>
> For your sample ECM (plus original data and one sample line to actually
> confirm median works) you would work with the following (Apologies for the
> very long TBLFM line):
>
> I was unable to find a built-in to determine the mode. I've found sample
> functions on Stack Overflow that would calculate it based on a list, but
> I'm not familiar enough with Org-Table format on how to go from cell
> references =@I..@II= to a list of values for the sake of manipulating them.
>
> : | Date | Sys | Dia | Pul | Sugar |
> : |----------------------+--------+--------+--------+--------|
> : | [2014-04-27 Sun] | 125 | 88 | 78 | 92 |
> : | [2014-04-28 Mon] | 102 | 88 | 86 | 92 |
> : | [2014-04-29 Tue] | 115 | 88 | 85 | 95 |
> : |----------------------+--------+--------+--------+--------|
> : | Averages: | 114.00 | 88.00 | 83.00 | 93.00 |
> : | Counts: | 3.00 | 3.00 | 3.00 | 3.00 |
> : | Maximums: | 125.00 | 88.00 | 86.00 | 95.00 |
> : | Medians: | 115.00 | 88.00 | 85.00 | 92.00 |
> : | Minimums: | 102.00 | 88.00 | 78.00 | 92.00 |
> : | Modes: | | | | |
> : | Standard Deviations: | 11.53 | 0.00 | 4.36 | 1.73 |
> : | Sums: | 342.00 | 264.00 | 249.00 | 279.00 |
> : |----------------------+--------+--------+--------+--------|
> : #+TBLFM: @>$2..@>$>=vsum(@I..@II);%.2f::@>>$2..@>>$>=vsdev(@I..@II
> );%.2f::@>>>>$2..@>>>>$>=vmin(@I..@II);%.2f::@>>>>>$2..@
>>>>>> $>=vmedian(@I..@II);%.2f::@>>>>>>$2..@>>>>>>$>=vmax(@I..@II);%.2f::@
>>>>>>>> $2..@>>>>>>>$>=vcount(@I..@II);%.2f::@>>>>>>>>$2..@
>>>>>>>>> $>=vmean(@I..@II);%.2f
>
> Regards,
> Jonathan
>
> On Tue, 2 Jun 2015, Jonathan Leech-Pepin wrote:
>>
>> Date: Tue, 2 Jun 2015 08:04:20
>>> From: Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
>>> To: Jude DaShiell <jdashiel@panix.com>
>>> Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
>>> Subject: Re: [O] searching for csv utilities
>>>
>>> Hello,
>>>
>>> On 2 June 2015 at 07:44, Jude DaShiell <jdashiel@panix.com> wrote:
>>>
>>> | Date | Sys | Dia | Pul | Sugar |
>>>> |------------------+-------------------+-----+-----+-------|
>>>> | [2014-04-27 Sun] | 125 | 88 | 78 | 92 |
>>>> | [2014-04-28 Mon] | 102 | 88 | 86 | 92 |
>>>> | Averages: | =$2=vmean(@<..@>) | | | |
>>>> #+TBLFM: $2=$2=vmean(@<..@>)
>>>>
>>>>
>>> The formula in question is the culprit in this case (at least as stated
>>> there).
>>>
>>> : $2=$2=vmean(@<..@>)
>>>
>>> Second column is equal to the second column which is equal to the mean of
>>> all the values in the second column (including the header "Sys").
>>>
>>> If you change the table as follows:
>>>
>>> | Date | Sys | Dia | Pul | Sugar |
>>> |------------------+-------+-----+-----+-------|
>>> | [2014-04-27 Sun] | 125 | 88 | 78 | 92 |
>>> | [2014-04-28 Mon] | 102 | 88 | 86 | 92 |
>>> |------------------+-------+-----+-----+-------|
>>> | Averages: | 113.5 | 88 | 82 | 92 |
>>> #+TBLFM: @>$2..@>$>=vmean(@I..@II)
>>>
>>> All the values will properly compute. If you want to avoid the second
>>> HLINE above Averages: then change =@II= to =@>>= (penultimate row)
>>>
>>> Regards,
>>> Jon
>>>
>>>
>>> This is a cut down version of my full record set. Sometimes when I key
>>>> formulas in I get ?ERROR back for a result after keying in c-c+c-c once
>>>> I've completed the formula and hit tab. If I do c-u+c-c+c-c that
>>>> sometimes
>>>> generated ?ERROR. Other times I key in a formula and the cursor gets
>>>> locked and I have to hit c-g to exit #+TBLFM: mode; I don't know what's
>>>> actually happening when that situation arises since other than suddenly
>>>> finding the cursor locked I can neither tell what state I'm in or if a
>>>> few
>>>> more keystrokes are needed or if I've generated an error situation.
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>>
>>>
>> --
>>
>>
>
--
next prev parent reply other threads:[~2015-06-03 21:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 11:44 searching for csv utilities Jude DaShiell
2015-06-02 12:04 ` Jonathan Leech-Pepin
2015-06-03 15:46 ` Jude DaShiell
2015-06-03 16:07 ` Jude DaShiell
2015-06-03 16:38 ` Jonathan Leech-Pepin
2015-06-03 21:12 ` Jude DaShiell [this message]
2015-06-03 22:01 ` Nick Dokos
2015-06-03 17:21 ` Nick Dokos
2015-06-03 18:04 ` Nick Dokos
2015-06-03 20:05 ` Michael Brand
2015-06-03 20:52 ` Nick Dokos
2015-06-04 7:21 ` e.fraga
2015-06-04 9:15 ` Michael Brand
2015-06-04 15:22 ` Nick Dokos
2015-06-04 15:43 ` Nick Dokos
2015-06-04 15:45 ` Michael Brand
2015-06-04 1:21 ` Jude DaShiell
2015-06-04 21:24 ` Thierry Banel
2015-06-05 7:13 ` Eric S Fraga
-- strict thread matches above, loose matches on Subject: below --
2015-06-19 0:58 Jude DaShiell
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=alpine.NEB.2.11.1506031711400.29145@panix1.panix.com \
--to=jdashiel@panix.com \
--cc=emacs-orgmode@gnu.org \
--cc=jonathan.leechpepin@gmail.com \
/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).