[R] print data.frame with a list column

Micha Silver t@v|b@r @end|ng |rom gm@||@com
Mon Jan 29 17:43:47 CET 2024


Excellent, many thanks.


On 29/01/2024 16:56, Ivan Krylov wrote:
> On Mon, 29 Jan 2024 14:19:21 +0200
> Micha Silver <tsvibar using gmail.com> wrote:
>
>> Is there some option to force printing the full list?
>> df <- data.frame("name" = "A", "bands" = I(list(1:20)))
> format.AsIs is responsible for printing columns produced using I(). It
> accepts a "width" argument:
>
> format(x, width = 9999)
> #   name                                                                 bands
> # 1    A 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
>
> It's more complicated with knitr::kable. Its format.args argument is
> only used with numeric arguments, but you can pre-format the table with
> knitr::kable(format(x, width = 9999)).
>
-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918



More information about the R-help mailing list