The following maps display different views of the places each member of our class has visited. Each map offers a different view by using variables such as number of visits, importance of each visit rated from 1-10 and he name of the place visited. Below is a snapshot of the data set:
Classmap <- read_excel("C:/Users/Enrique/OneDrive/Documents/HU/ANLY512_DataVisualization/Data sets/ClassMap50.xlsx",
col_types = c("text", "text", "text",
"text", "text", "text", "text",
"numeric", "text", "text"))
Classmap$Latitude = as.numeric(Classmap$Latitude)
Classmap$Longitude = as.numeric(Classmap$Longitude)
Classmap$NumberVisits= as.numeric(Classmap$NumberVisits)
head(Classmap)
## # A tibble: 6 x 10
## NameOfSite Country Latitude Longitude NumberVisits TypeofSite
## <chr> <chr> <dbl> <dbl> <dbl> <chr>
## 1 State Mus~ United~ 40.3 -76.9 5 arts and ~
## 2 Harrisbur~ United~ 40.3 -76.9 8 arts and ~
## 3 Leo Matus~ United~ 41.2 -75.9 122 other
## 4 "Bar Buff~ Russia 55.7 37.6 3 entertain~
## 5 Elarji Re~ Russia 55.7 37.6 5 entertain~
## 6 Restauran~ Russia 55.8 37.6 2 entertain~
## # ... with 4 more variables: BestSeasontoVist <chr>,
## # Importance_1_10 <dbl>, RawCoords <chr>, X__1 <chr>
Each icon represents a locaiton someone in our class has visited.
leaflet(Classmap) %>% addProviderTiles(providers$OpenStreetMap.BlackAndWhite) %>%
addAwesomeMarkers(~Longitude, ~Latitude, icon= awesomeIcons(iconColor = "yellow"),
label = ~as.character(Classmap$NameOfSite))
Radius displays importance level for places visited in North America. The Leo Matus Market is the locaiton with the highest level of importance.
leaflet(Classmap) %>% addProviderTiles(providers$Esri) %>%
addCircles(~Longitude, ~Latitude, weight = 1, label = ~as.character(Classmap$NameOfSite),
radius = (Classmap$NumberVisits*5000)) %>%
setView(Classmap, lat= 31.766296 , lng = -106.490571, zoom = 3)
The red points represent places with an importance score greater to five, which is considered important, the blue points represent the “not so important” places.
Classmap$Importance = ifelse(Classmap$Importance_1_10>5,"Important","Not Important")
leaflet(Classmap) %>%
addProviderTiles(providers$OpenStreetMap) %>%
addProviderTiles(providers$Stamen.TonerLabels) %>%
addCircles(color = ifelse(Classmap$Importance=="Important","red","blue"),
popup = as.character(Classmap$Importance))
A polygon with the shape of the U.S. border lines is used in conjunciton with the places visited in the U.S.
Our class is composed of students that live in different parts of the country but the entire class only selected places that within close proximity to the University.
mapStates = map("state", fill = TRUE, plot = FALSE)
Us= Classmap %>%
select(Latitude, Longitude, NameOfSite, NumberVisits) %>%
filter(Classmap$Country %in% "United States")
leaflet(mapStates) %>% addPolygons(color = "green",stroke =F) %>%
addMarkers(Us,lng = Us$Longitude, lat = Us$Latitude, popup= ~as.character(Us$NameOfSite)) %>%
setView(Classmap, lat= 39.100849 , lng = -94.578437, zoom = 3.2)