Your webpage must contain the date that you created the document, and it must contain a map created with Leaflet. We would love to see you show off your creativity! Review criterialess The rubric contains the following two questions:
Getting, selecting the data and performing the information processing:
# Access the data contained in a .csv text file.
geodata <- read.csv(file = "D:/Cursos/Courcera/_Johns Hopkins/__Data Science/_09- Developing Data Products/Data/PopResidUFBra_2007.csv",
header = TRUE,
sep = ";")
#Selects the 27 cities with the highest number of inhabitants.
my_map <- data.frame(city = geodata$City,
pop = c(geodata$Pop_2007),
lat = c(geodata$Latitude),
lng = c(geodata$Longitude)
)
# External package that provides provides a range of functions and axle labeling algorithms
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.4.2
map <- my_map %>%
leaflet() %>%
addTiles() %>%
addMarkers(lng=my_map$lng,
lat=my_map$lat,
popup=paste(my_map$city, "<br>Population: ",
formatC(my_map$pop, format = "d", big.mark = ",")
)
)%>%
# Displays the circle according to the population on the map..
addCircles(lng = my_map$lng,
lat = my_map$lat,
weight = 1,
radius = (my_map$pop)/100,
popup = strwrap(my_map$city)
)
map