library(gt) library(dplyr) library(magrittr) islands_tbl <- tibble(name = names(islands),size = islands) %>% arrange(desc(size)) %>% slice(1:10) # Display the table # Create a display table showing ten of # the largest islands in the world gt_tbl <- gt(islands_tbl) # Make a display table with the `islands_tbl` # table; put a heading just above the column labels #gt_tbl <- # gt_tbl %>% # tab_header( # title = "Large Landmasses of the World", # subtitle = "The top ten largest are presented" # ) gt_tbl <- gt_tbl %>% tab_row_group( label = "continent", rows = 1:6 ) # Show the gt Table gtsave(gt_tbl, file = "table.html")