Create a web page using R Markdown that features a map created with Leaflet.
Host webpage on either GitHub Pages, RPubs, or NeoCities.
The Ivy League is an American collegiate athletic conference comprising sports teams from eight private universities in the Northeastern United States. The term Ivy League is typically used to refer to those eight schools as a group of elite colleges beyond the sports context. Ivy League has connotations of academic excellence, selectivity in admissions, and social elitism.
I am going to show all eight Ivy league Universities:
Brown University
Columbia University
Cornell University
Darmouth College
Harvard University
The University of Pennsylvania
Princeton University
Yale University
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.5.3
library(knitr)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
ivySites<-c("<a href= 'http://www.brown.edu/' >Brown</a>",
"<a href= 'http://www.columbia.edu/'>Columbia</a>",
"<a href= 'http://www.cornell.edu/'>Cornell</a> ",
"<a href= 'http://home.dartmouth.edu/'>Darmouth</a>",
"<a href= 'http://www.harvard.edu/'>Harvard</a>",
"<a href= 'http://www.upenn.edu/'>university of Pennsylvania</a>",
"<a href= 'http://www.princeton.edu/'>Princeton</a>",
"<a href= 'http://www.yale.edu/'>yale</a>")
ivyLatLng<-data.frame(lat= c( 41.8268, 40.8075, 42.4534, 43.7044, 42.3770, 39.9522, 40.3431, 41.3163),
lng= c(-71.4025, -73.9626, -76.4735, -72.2887, -71.1167, -75.1932, -74.6551, -72.9223))
ivyLatLng %>%
leaflet() %>%
addTiles() %>%
addMarkers(popup = ivySites)
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.