this is a misunderstanding, the example and description show that this code adds a column visibility button that allows some chosen columns to be hidden by pressing their buttons in the column vis butto; in this example the 1st column can not be hidden as it has been left off the list.
Here is an amendment to the code which shows adjusting the initial hidden columns.
library(DT)
datatable(
iris, rownames = FALSE,
extensions = 'Buttons', options = list(
dom = 'Bfrtip',
buttons = list(list(extend = 'colvis', columns = c(0,1,2,3,4))) # all 5 are hideable/showable by the button
,columnDefs = list(list(visible=FALSE, targets=c(0,1)) # first two start hidden
)
))