From 538280 at gmail.com  Tue May 27 19:24:06 2014
From: 538280 at gmail.com (Greg Snow)
Date: Tue, 27 May 2014 11:24:06 -0600
Subject: [Rd] Pretty-printer for R data
In-Reply-To: <CACLVabWAAiTj6muOq8Fh7i3pQz8fV02zEeo1N1XEFqy2yBkvRg@mail.gmail.com>
References: <CACLVabWAAiTj6muOq8Fh7i3pQz8fV02zEeo1N1XEFqy2yBkvRg@mail.gmail.com>
Message-ID: <CAFEqCdwgV88KLM8OtswjdbfQQZBnr-KnBMzX-FqdYBWii0XWpg@mail.gmail.com>

There are editors that are R aware and have some functionality along
these lines (though I don't know of any command line type).  Some to
look at are the Emacs/ESS combination or Rstudio.

On Tue, May 27, 2014 at 11:10 AM, Stavros Macrakis (??????? ????????)
<macrakis at alum.mit.edu> wrote:
> Is there a pretty-printer for R data (and code for that matter), similar to
> Lisp's prettyprint/grind? I've looked in CRAN, and couldn't find anything.
>
> For example, I'd like to have:
>
> prettyprint(list(a=1:20*2, b=list(data.frame(q = c(2,1,3),
>   r = c(3,1,2), s = c(1,3,2)), as.POSIXct("2014-02-03")))
>
> *      =>*
>
> list(a = c(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22,
>            24, 26, 28, 30, 32, 34, 36, 38, 40),
>      b = list(data.frame(q = c(2, 1, 3),
>                          r = c(3, 1, 2),
>                          s = c(1, 3, 2))
>               as.POSIXct("2014-02-03")))
>
> That is, something like dput, but with operators, structural indentation,
> and line breaks chosen intelligently. (Whether to use as.POSIXct or
> structure(...) etc. presumably could be under control of parameters.)
>
>              -s
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com



[Rd] Pretty-printer for R data
Greg Snow