As per below the documentation (https://rstudio.github.io/DT/extensions.html), the below code should collapse first and second columns by default(0,1), but when tried it is displaying all columns by default.
Can we have only 2 columns displayed by default?
datatable(
iris2, rownames = FALSE,
extensions = 'Buttons', options = list(
dom = 'Bfrtip',
buttons = list(list(extend = 'colvis', columns = c(2, 3, 4)))
)
)