The deforestation of the Amazon forest occurs for several reasons, such as illegal agriculture, natural disasters, urbanization, and mining, being frequent the occurence of burning and or wood extraction. This data set was obtained from a file “inpebrazilianamazonfires1999_2019”, from the National Institute for Space Research (INPE), which brings the number of firespot in the Brazilian Amazon by state, month and year, from 1999 to 2019. The original data are public and were extracted from the INPE website on December 13, 2019. Available at https://www.kaggle.com/mbogernetto/brazilian-amazon-rainforest-degradation?select=inpe_brazilian_amazon_fires_1999_2019.csv.
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
library(leaflet)
## Warning: package 'leaflet' was built under R version 4.0.3
data<- read.csv("inpe_brazilian_amazon_fires_1999_2019.csv", header = T)
head(data)
## year month state latitude longitude firespots
## 1 1999 1 AMAZONAS -2.371113 -59.89993 3
## 2 1999 1 MARANHAO -2.257395 -45.48783 36
## 3 1999 1 MATO GROSSO -12.660633 -55.05799 18
## 4 1999 1 PARA -2.474820 -48.54697 87
## 5 1999 1 RONDONIA -12.861700 -60.51310 1
## 6 1999 1 RORAIMA 3.403225 -60.62285 15
data<-mutate(data, popups = paste("Year=", year, ", Firespots=", firespots))
popups<-as.character(data$popups)
The image used for the icon was obtained from https://www.flaticon.com/br/icone-gratis/, and the icon was created by makeIcon() function.
iconset <- iconList(
Fire = makeIcon(iconUrl = "https://www.flaticon.com/svg/static/icons/svg/785/785116.svg",iconWidth = 31*215/230, iconHeight = 31, iconAnchorX = 31*215/230/2, iconAnchorY = 16))
The map was created using the Leaflet package. Enjoy it!
map<-leaflet() %>%
addTiles() %>%
addMarkers(lat=data$latitude,
lng=data$longitude,
icon = iconset,
clusterOptions = markerClusterOptions(),
popup = popups)
map