The leaflet package is very useful for making maps.
library(leaflet)m <-leaflet() %>%addTiles() %>%# Add default OpenStreetMap map tilesaddMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")m # Print the map
Lets find our current location using latlong.net and make a map. So now
m_csueb <-leaflet() %>%addTiles() %>%# Add default OpenStreetMap map tilesaddMarkers(lng=-122.053765, lat=37.656057, popup="Stat. 651 on the CSU East Bay campus.") m_csueb # Print the map
Plot.ly
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.3 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ ggplot2 3.4.3 ✔ tibble 3.2.1
✔ lubridate 1.9.2 ✔ tidyr 1.3.0
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(plotly)
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
The streamgraph package is not available on CRAN. It needs to be installed using devtools. To install uncomment the first two lines of the code chunk below. When asked to update other packages, select No.
# library(devtools)# install_github("hrbrmstr/streamgraph")library(streamgraph)library(RColorBrewer)Beatles %>%streamgraph(key ="name", value ="n", date ="year") %>%sg_fill_brewer("Accent")
Warning in widget_html(name, package, id = x$id, style = css(width =
validateCssUnit(sizeInfo$width), : streamgraph_html returned an object of class
`list` instead of a `shiny.tag`.
Warning: `bindFillRole()` only works on htmltools::tag() objects (e.g., div(),
p(), etc.), not objects of type 'list'.
Warning in widget_html(name, package, id = x$id, style = css(width =
validateCssUnit(sizeInfo$width), : streamgraph_html returned an object of class
`list` instead of a `shiny.tag`.
Warning: `bindFillRole()` only works on htmltools::tag() objects (e.g., div(),
p(), etc.), not objects of type 'list'.
Warning in widget_html(name, package, id = x$id, style = css(width =
validateCssUnit(sizeInfo$width), : streamgraph_html returned an object of class
`list` instead of a `shiny.tag`.
Warning: `bindFillRole()` only works on htmltools::tag() objects (e.g., div(),
p(), etc.), not objects of type 'list'.