X

Renewable electricity output – World Map

# ----------------

library(rworldmap)

options("scipen"=100, "digits"=4)

year <- 2015
target.year <- which(renewable.electricity.output$year==year)
head(renewable.electricity.output[target.year,])

renewable.electricity.output.year <- na.omit(renewable.electricity.output[target.year,])
renewable.electricity.output.year <- renewable.electricity.output.year[which(renewable.electricity.output.year$EG.ELC.RNEW.ZS>0),]

mapped_data <- joinCountryData2Map(renewable.electricity.output.year, joinCode = "ISO2", nameJoinColumn = "iso2c")
par(mai=c(0,0,0.2,0),xaxs="i",yaxs="i")
mapCountryData(mapped_data, nameColumnToPlot = "EG.ELC.RNEW.ZS",mapTitle=paste(titel,subtitel))

mapCountryData(mapped_data, nameColumnToPlot = "EG.ELC.RNEW.ZS",mapRegion="world",mapTitle=paste(titel,subtitel),
               numCats=2,catMethod=c(0:100),addLegend=FALSE,colourPalette=c("red","green"))

 

mapCountryData(mapped_data, nameColumnToPlot = "EG.ELC.RNEW.ZS",mapRegion="world",mapTitle=paste(titel,subtitel),
               numCats=3,catMethod=c(0:100),addLegend=FALSE,colourPalette=c("red","yellow","green"))
legend(-179, -10, legend=c("low", "medium","high"), col=c("red", "yellow","green"), lty=1:3, cex=0.6)

 

 

 

 

Martin Stoppacher: