library(DT)
library(tidyverse)
library(knitr)
Chapter 30
Quarto Formats
30.5 Interactivity
30.5.1. htmlwidgets
Let us try to create an interactive map in HTML below Figure 1:—̥
library(leaflet)
leaflet() |>
setView(76.801175, 30.761403, zoom = 14) |>
addTiles() |>
addMarkers(76.801175, 30.761403,
popup = "Haryana Civil Secretariat") |>
addMarkers(76.803773534,
30.752910586,
popup = "Rock Garden")
Using DT
for interactive tables:---
An example of using DT
for an interactive table is at Figure 2 :---
|>
diamonds filter(carat > 3) |>
datatable(colnames = c("Carat", "Cut", "Color",
"Clarity", "Depth", "Table",
"Price", "X", "Y", "Z"),
rownames = FALSE)