Interactive tables are extremely useful for presenting data directly to your audience for them to explore, much like an Excel document. Interactivity typically includes; ability to filter individual columns, reorder columns in ascending/descending order and a filter across the entire table. Often conditional formatting is applied to tables to highlight/label data.
Required Data:
Below is a minimal example of an interactive table using R
and the DT
library.
country | continent | year | lifeExp | pop | gdpPercap |
---|---|---|---|---|---|
Afghanistan | Asia | 1952 | 28.801 | 8425333 | 779.4453145 |
Afghanistan | Asia | 1957 | 30.332 | 9240934 | 820.8530296 |
Afghanistan | Asia | 1962 | 31.997 | 10267083 | 853.10071 |
Afghanistan | Asia | 1967 | 34.02 | 11537966 | 836.1971382 |
Afghanistan | Asia | 1972 | 36.088 | 13079460 | 739.9811058 |