From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Bogner Subject: Re: formatting org-babel output Date: Wed, 22 May 2013 12:27:23 -0400 Message-ID: References: <8761ybrpk5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfBtI-0002e0-Ju for emacs-orgmode@gnu.org; Wed, 22 May 2013 12:27:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfBtF-0003ew-Kd for emacs-orgmode@gnu.org; Wed, 22 May 2013 12:27:52 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:50297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfBtF-0003ei-DN for emacs-orgmode@gnu.org; Wed, 22 May 2013 12:27:49 -0400 Received: by mail-we0-f169.google.com with SMTP id q55so1445188wes.0 for ; Wed, 22 May 2013 09:27:48 -0700 (PDT) In-Reply-To: <8761ybrpk5.fsf@gmail.com> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org 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 wrote: > Joe Bogner 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 >