[Experimental]

This function displays a data frame as a html table using the reactable package. The top ten rows in the table are displayed with the options to click through or display all the rows. The ability to search for table content and sort columns is also available.

display_table(data, rows = nrow(data))

Arguments

data

A data frame containing the data to display.

rows

Number of rows to display as an integer with total row number as the default.

Value

A html table displaying the first page of the data limited to the specified number of rows.

Examples

suppressPackageStartupMessages({ library(store) suppressWarnings({ library(palmerpenguins) library(dplyr) }) }) # select top 5 heaviest penguins from each species on each island heaviest_penguins <- penguins %>% select(species, island, body_mass_g) %>% group_by(species, island) %>% arrange(desc(body_mass_g)) %>% slice_head(n = 5) %>% ungroup() heaviest_penguins
#> # A tibble: 25 x 3 #> species island body_mass_g #> <fct> <fct> <int> #> 1 Adelie Biscoe 4775 #> 2 Adelie Biscoe 4725 #> 3 Adelie Biscoe 4600 #> 4 Adelie Biscoe 4400 #> 5 Adelie Biscoe 4300 #> 6 Adelie Dream 4650 #> 7 Adelie Dream 4600 #> 8 Adelie Dream 4475 #> 9 Adelie Dream 4450 #> 10 Adelie Dream 4400 #> # ... with 15 more rows
if (FALSE) { # display table of penguin weights for each species on each island display_table(heaviest_penguins) }