The Amazon rainforest made headlines around the world earlier this year following record fires. The Amazon rainforest has been burning at a record rate this year and more than 120,000 fires have been detected since the start of the year. The devastating fires are destroying the homes of indigenous tribes and threatening millions of animals.
Deforestation in the Brazilian Amazon has surged to its highest rate in more than a decade, according to new data from Brazil’s National Institute for Space Research (INPE). It’s an alarming development in one of the most critical ecosystems for the planet.
The Amazon has one of the highest concentrations of biodiversity in the world. Its trees keep the air cool, cycle moisture, and generate about half its own rainfall while also providing water to nearby farms and cities. Its vegetation and soil are a massive reservoir of carbon that become a source of emissions with fires and deforestation. So losing swaths of rainforest threatens regional rainfall patterns, the global climate, and some of the most unique forms of life on the planet.
For this project, I’ll explore questions such as:
+What caused the Amazon fires
+Why are the Amazon fires such a big deal?
+What can be done to stop deforestation?
Data cane be found at :
(https://databank.worldbank.org/source/world-development-indicators)
(https://cdiac.ess-dive.lbl.gov/trends/emis/tre_glob_2013.html)
library(knitr)
library(reshape2)
library(DT)
library(ggplot2)
library(plotly)
library(dplyr)
library(openintro)
library(ggvis)
library(tidyr)
library(ggplot2)
library(plotly)
library(plyr)
library(dplyr)
library(tidyr)
library(ggplot2)
library(plotly)
#load data
amazon = read.csv("https://raw.githubusercontent.com/ErindaB/Data-607-Projects/master/Forest%20Land.csv",header = TRUE, sep = ",")
#Rename column
names(amazon)<- c("Country","Country.Code","Series.Name","Series.Code","YR1990","YR1995","YR2000","YR2005","YR2010","YR2015","YR2016")
amazon <- amazon[,c('Country','Series.Code','YR1990','YR1995','YR2000','YR2005','YR2010','YR2015','YR2016')]
datatable(amazon)
#Separate Forest area and Agricultural area in 2 dataframes
Forest_area <- amazon %>% filter (Series.Code == "AG.LND.FRST.ZS")
Agricultural_area <- amazon %>% filter (Series.Code == "AG.LND.AGRI.ZS")
#Remove series.code column
Forest_area$Series.Code<-NULL
Forest_area1 <- gather(Forest_area, "Year","Forest_Perc",-Country)
## Warning: attributes are not identical across measure variables;
## they will be dropped
#Select forest_area's data for Brazil
Forest_area1_br<-Forest_area1 %>% filter (Country == "Brazil")
Forest_area1_br
## Country Year Forest_Perc
## 1 Brazil YR1990 65.40988785
## 2 Brazil YR1995 63.88855654
## 3 Brazil YR2000 62.36722524
## 4 Brazil YR2005 60.62760375
## 5 Brazil YR2010 59.63743129
## 6 Brazil YR2015 59.04878358
## 7 Brazil YR2016 58.93105404
#Remove series.code column
Agricultural_area$Series.Code<-NULL
Agricultural_area1 <- gather(Agricultural_area, "Year","Agricultural_Perc",-Country)
## Warning: attributes are not identical across measure variables;
## they will be dropped
#Select Agricultural_area's data for Brazil
Agricultural_area_br<-Agricultural_area1 %>% filter (Country == "Brazil")
Agricultural_area_br
## Country Year Agricultural_Perc
## 1 Brazil YR1990 28.90690991
## 2 Brazil YR1995 30.9245837
## 3 Brazil YR2000 31.27561874
## 4 Brazil YR2005 32.5948828
## 5 Brazil YR2010 32.71816457
## 6 Brazil YR2015 33.98878219
## 7 Brazil YR2016 33.92453345
#load CO2 emmission data
fuel_raw <- read.csv("https://raw.githubusercontent.com/ErindaB/Data-607-Projects/master/CO2.csv", stringsAsFactors = FALSE)
names(fuel_raw)
fuel_em <- data.frame(fuel_raw$Year,fuel_raw$Total.carbon.emissions.from.fossil.fuel)
names(fuel_em) <- c("year", "emissions")
#Table Showing Global CO2 Emissions
datatable(fuel_em)
***
#Load global temperature data
global_temp <- read.csv("https://raw.githubusercontent.com/ErindaB/Data-607-Projects/master/Anomalitites_temp.csv", stringsAsFactors = FALSE)
names(global_temp)
global_temp_anomaly <- data.frame(global_temp$Year, global_temp$Glob)
#Removing everything but data from desired time frame
global_temp_anomaly <- global_temp_anomaly[-c(1:110, 135, 136),]
names(global_temp_anomaly) <- c("year", "anomaly")
#Table Showing GlobalTemperature Index (Anomaly with Base: 1990-2013)
datatable(global_temp_anomaly, options = list(pageLength = 10))
Let’s have an understanding on how forest land has changed in Brazil during 1990-2016
ggplot(Forest_area1_br, aes(Year, Forest_Perc, group = 1, color = Forest_Perc)) +
geom_point() +
geom_line() +
labs(x = "Year", y = "Percentage of Forest area",
title = "Percentage of Forest area in Brazil from 1990-2016") +
theme(plot.title = element_text(hjust = 0.5))
It is clearly evident that Amazon has lost more than 35% of forest land in 16 years. There is no doubt that this rise in fire activity is associated with a sharp rise in deforestation.
Let’s see if agriculture land has changed in Brazil from 1990-2016
ggplot(Agricultural_area_br, aes(Year, Agricultural_Perc, group = 1, color = Agricultural_Perc)) +
geom_point() +
geom_line() +
labs(x = "Year", y = "Percentage of Agricultural land",
title = "Percentage of Agricultural land in Brazil from 1990-2016") +
theme(plot.title = element_text(hjust = 0.5))
Farming and agriculture are necessary for human survival. According to the plot we see a steady rise in the agriculture area in the last 2 decades in Amazon. The Amazon rainforest has been facing the issue, with farming practices taking the space of much-needed animal habitats and leading to the destruction of large amounts of land.For the most part, farming in the Amazon has gotten a bad reputation for destroying rainforest land and habitats and leading to its commercialization. This extreme clearing of land, especially for animal agriculture, results in habitat loss, amplification of greenhouse gases, disruption of water cycles, increased soil erosion, and excessive flooding.
Everyone on the planet benefits from the health of the Amazon. As its trees take in carbon dioxide and release oxygen, the Amazon plays a huge role in pulling planet-warming greenhouse gases out of the atmosphere. Without it, climate change speeds up. But as the world’s largest rainforest is eaten away by logging, mining, and agribusiness, it may not be able to provide the same buffer.
We will take a look at global yearly CO2 emission data caused by human actions:
CO2 <- ggplot(fuel_em, aes(year, emissions, group = 1, color=emissions)) +
geom_line() +
geom_point(size = 1) +
labs(x = "Year", y = "CO2 emissions (million metric tons)",
title = " CO2 emissions caused by humans (1990-2013)") +
theme(axis.text.x = element_text(angle = 90, hjust = 1), axis.text=element_text(size=6))
ggplotly(CO2)
The plot shows that CO2 emissions grew every year with a strong upward trend.
Next we will analyze global temperature during 1990-2013
ggplot(global_temp_anomaly, aes(year, anomaly, group = 1, color = anomaly)) +
geom_point() +
geom_line() +
labs(x = "Year", y = "Temparature Anomaly",
title = "Temparature Anomaly during 1990-2013") +
theme(plot.title = element_text(hjust = 0.5))
Temparature Anomaly has more movement but from the shape we can conclude it also has a strong upward trend.
For the linear Regression I will analyze the relationship between :
+forest area and agricultural area as 2 variables which have an impact on Amazon fires
+CO2 emissions and Global temperature
#Forest area vs agricultural area
#Join two tables
all_data <- cbind(Agricultural_area_br, Forest_area1_br$Forest_Perc)
names(all_data) <- c("year", "Agricultural_Perc", "Forest_Perc")
write.csv(all_data, file = "agr_for.csv")
new_data <-read.csv("https://raw.githubusercontent.com/ErindaB/Data-607-Projects/master/agr_for.csv", stringsAsFactors = FALSE)
raw_data <- mutate(new_data)
wide_data <- gather(raw_data,"type", "value", 3,4)
ggplot(data = wide_data, aes(x = year, y = value, fill = type)) +
geom_bar(stat="identity", position="dodge") +
theme(legend.position = "dodge") +
xlab("Year") + ylab("Forest % and Agricultural %") +
ggtitle("Forest Percentage and Agricultural Percentage area
in Amazon from 1990-2016") +
theme(plot.title = element_text(hjust = 0.5))
model <- lm(Agricultural_Perc ~ Forest_Perc, data = new_data)
summary(model)
##
## Call:
## lm(formula = Agricultural_Perc ~ Forest_Perc, data = new_data)
##
## Residuals:
## 1 2 3 4 5 6 7
## -0.34850 0.60563 -0.10688 -0.00377 -0.57271 0.28639 0.13984
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 74.98271 4.26835 17.57 1.1e-05 ***
## Forest_Perc -0.69909 0.06945 -10.07 0.000166 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4311 on 5 degrees of freedom
## Multiple R-squared: 0.953, Adjusted R-squared: 0.9436
## F-statistic: 101.3 on 1 and 5 DF, p-value: 0.0001656
plot(new_data$Agricultural_Perc ~ new_data$Forest_Perc)
abline(model)
I got a result of R2 of 0.953 that means the forest area and agriculture area have a very strong correlation.That explains the decrease in forest area in amazon with the increase of agriculture area in the first analysis. Also a very low p-value indicates we can indicates that we can reject null hypothesis and conclude there is a statistically strong relationship between the two variables and from the plot we can conclude there is a strong positive linear relationship between the two variables.
#CO2 vs Global Temp
#Join two tables
co2_temp <- cbind(fuel_em, global_temp_anomaly$anomaly)
co2_temp
names(co2_temp) <- c("year", "emissions", "anomaly")
write.csv(all_data, file = "REG_DATA.csv")
new_data1 <-read.csv("https://raw.githubusercontent.com/ErindaB/Data-607-Projects/master/REG_DATA.csv", stringsAsFactors = FALSE)
#The CO2 emission data are scaled down to a 1:1000 ratio for a better visualization next to temperature anomalities
global_data_raw <- mutate(new_data1, scaled_emissions = emissions/1000)
global_data <- gather(global_data_raw,"type", "value", 3,4)
ggplot(data = global_data, aes(x = year, y = value, fill = type)) +
geom_bar(stat="identity", position="dodge") +
theme(legend.position = "dodge") +
xlab("Year") + ylab("Temp Anomaly & CO2 Emissions(1:1000)") +
ggtitle(" Human Caused CO2 Emission(1:1000)
and Temperature Anomaly from 1990-2013") +
theme(plot.title = element_text(hjust = 0.5))
model2 <- lm(anomaly ~ emissions, data = new_data1)
summary(model2)
##
## Call:
## lm(formula = anomaly ~ emissions, data = new_data1)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.17717 -0.07725 0.01503 0.05204 0.18449
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.011e-01 1.198e-01 -0.844 0.408
## emissions 8.318e-05 1.583e-05 5.255 2.85e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.09614 on 22 degrees of freedom
## Multiple R-squared: 0.5566, Adjusted R-squared: 0.5364
## F-statistic: 27.62 on 1 and 22 DF, p-value: 2.847e-05
plot(new_data1$anomaly ~ new_data1$emissions)
abline(model2)
I get a R2 of 0.5566 and a very low p-value which indicate that there is a statistically significant relationship between the two variables,thus we reject the null hypothesis and from the plot we can conclude there is a strong positive linear relationship between the two variables.The correlation between the two variable is very strong.
-Deforestation and increase of agricultural land during the last 2 decades are the main cause for the Amazon Fires.
-Amazon called as the ‘lungs of the world’ it produces 20% of the world’s oxygen,plays a huge role in pulling planet-warming greenhouse gases out of the atmosphere. Without it, climate change speeds up.
-The linear regression model proved that deforestation is related with the increase of agricultural land as the main causation of the Amazon fires ,and also the increase level of CO2 emissions around the world is correlated with global temperature anomalies.
-Data Analyst jobs appear to want a focused, insightful professional, who can analyze the results of research of their own design to come up with insights that they can then use to focus on training others within the organization.
Each one of us can has a role to play in order to stop save forests and wildlife while stabilizing our climate by:
+Supporting efforts to amplify the voices of Indigenous Peoples and traditional forest communities.
+Reduce consumption of single-use products.
+Make informed food choices. There is a myriad of reasons to adopt a plant-based diet or reducing your consumption of animal products including the protection of forests and nature.
+Avoid false solutions like biofuels, biomass or carbon offsets that rely on wishful thinking, yet in practice release more greenhouse gas emissions
+Demand that companies commit to reduce deforestation through forest-friendly policies and follow through on those commitments
+Demand that your governments only source forest commodities in a way that ensures the protection of nature and respects human rights