emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joe Bogner <joebogner@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: formatting org-babel output
Date: Wed, 22 May 2013 12:27:23 -0400	[thread overview]
Message-ID: <CAEtzV1ZMwXkAeiX-3X4w4iZNvewzzELi3keFeWcDZbDrTEDYXA@mail.gmail.com> (raw)
In-Reply-To: <8761ybrpk5.fsf@gmail.com>

Eric - That is perfect. It's exactly what I was looking for. Thank you
for very much!

Jay - format is a good option too.I also found the scales packages

> scales::comma(scales::dollar(55555))
[1] "$55,555"

In the end, the org-mode post solution feels more automatic and in the
right layer - since I'm using org-mode for presentation of the R
results.

Thanks again
Joe

On Wed, May 22, 2013 at 9:12 AM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Joe Bogner <joebogner@gmail.com> writes:
>
>> I am using org-mode and babel with R for reproducible research. I
>> would like certain numbers in the output tables to be formatted for
>> easier reading - such as eliminating decimals and adding commas for
>> readability.
>>
>> The best I came up with is to use a TBLFM line at the bottom of my
>> results table using a function I found on the ElispCookbook on
>> emacswiki. A simple example is below that doesn't require R to
>> reproduce.
>>
>> It's a two step process currently to execute the R code in org-babel
>> and then jump to the result table TBLFM line and  Ctrl+c Ctrl+c to
>> format the table
>>
>> Is there a better way to format table outputs for simple things like
>> currency? I would be content if it's only during the org export
>> process too
>>
>
> You can use the recently introduced :post header argument to
> post-process the output of a code block.  The following example
> demonstrates the use of this argument to apply your number-grouper
> function to table output.
>
>
>
> Cheers,
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte
>

  reply	other threads:[~2013-05-22 16:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 11:18 formatting org-babel output Joe Bogner
2013-05-22 13:12 ` Eric Schulte
2013-05-22 16:27   ` Joe Bogner [this message]
2013-05-22 13:14 ` Jay Kerns

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=CAEtzV1ZMwXkAeiX-3X4w4iZNvewzzELi3keFeWcDZbDrTEDYXA@mail.gmail.com \
    --to=joebogner@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@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).