display_table | R Documentation |
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))
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. |
A html table displaying the first page of the data limited to the specified number of rows.
suppressPackageStartupMessages({
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
## Not run:
# display table of penguin weights for each species on each island
display_table(heaviest_penguins)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.