Search code examples
rdatatabledtdatatable-buttons

How can I show all the entries with datatable in R? (DT package)


I have just found that DT package has an extension with gives you the chance to get the tables in CSV, PDF, etc. The first time, the entries didn't appear, but I saw that if I write dom = 'Blfrtip' they appear.

However, is there a way to have the option "show ALL the entries" of the table?

Now, the maximum entries are 100.

image

The code:

datatable(
  iris, extensions = 'Buttons', options = list(
    dom = 'Blfrtip',
    buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
  )
)

Thanks in advance,

Regards


Solution

  • Trying some things I found the solution:

    datatable(
      iris, extensions = 'Buttons', options = list(
        dom = 'Blfrtip',
        buttons = c('copy', 'csv', 'excel', 'pdf'),
        lengthMenu = list(c(10,30, 50, -1), 
                          c('10', '30', '50', 'All')),
        paging = T)
    )