[datatable-help] print.data.table's digits argument

Frank Erickson FErickson at psu.edu
Tue Jun 18 01:39:39 CEST 2013


Ah, that did the trick! I'll use this quite a lot, I expect. Thanks, Arun.
--Frank


On Mon, Jun 17, 2013 at 6:19 PM, Arunkumar Srinivasan <aragorn168b at gmail.com
> wrote:

>  Dear Frank,
>
> Thanks for forwarding to the list. I always seem to forget to "reply-all".
> Apologies. Managed this time! :)
>
> Try this on your data:
>
> as.data.table(do.call("cbind", lapply(DT, function(x) {
> if (is.list(x)) {
> lapply(x, function(y) as.numeric(format(y, digits=2)))
>  } else
> as.numeric(format(x, digits=2))
> })))
>
>
>
> Arun
>
>
>
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20130617/b0215422/attachment.html>


More information about the datatable-help mailing list