Leaflet is a JavaScript library for creating dynamic maps that support panning and zooming along with various annotations like markers, polygons, and popups.
library(leaflet)
leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
Dygraphs provides rich facilities for charting time-series data in R and includes support for many interactive features including series/point highlighting, zooming, and panning.
library(dygraphs)
lungDeaths = cbind(mdeaths, fdeaths)
dygraph(lungDeaths) %>%
dySeries("mdeaths", label = "Male") %>%
dySeries("fdeaths", label = "Female") %>%
dyOptions(stackedGraph = TRUE) %>%
dyRangeSelector(height = 20)
Plotly allows you to easily translate your ggplot2 graphics to an interactive web-based version, and also provides bindings to the plotly.js graphing library.
library(ggplot2)
library(plotly)
p = ggplot(data = diamonds, aes(x = cut, fill = clarity)) +
geom_bar(position = "dodge")
ggplotly(p)
visNetwork provides an interface to the network visualization capabilties of the vis.js library.
library(visNetwork)
nodes = data.frame(id = 1:6, title = paste("node", 1:6),
shape = c("dot", "square"),
size = 10:15, color = c("blue", "red"))
edges = data.frame(from = 1:5, to = c(5, 4, 6, 3, 3))
visNetwork(nodes, edges) %>%
visOptions(highlightNearest = TRUE, nodesIdSelection = TRUE)
networkD3 provides tools for creating D3 JavaScript network graphs from R.
# Load package
library(networkD3)
# Create fake data
src = c("A", "A", "A", "A", "B", "B", "C", "C", "D")
target = c("B", "C", "D", "J", "E", "F", "G", "H", "I")
networkData = data.frame(src, target)
# Plot
simpleNetwork(networkData)
DataTables displays R matrices or data frames as interactive HTML tables that support filtering, pagination, and sorting.
library(DT)
datatable(iris, options = list(pageLength = 5))