March 2019
Beginner to intermediate
250 pages
6h 6m
English
Using the rworldmap package, we can create a map and display the credit ratings by country. Let's focus on the last available credit rating (from May 2018), as follows:
macro2017<-macroeconomic_data[macroeconomic_data$Year==2017,]library(rworldmap)Map <- joinCountryData2Map(macro2017, joinCode = "ISO2", nameJoinColumn = "CountryISO")
A quick summary can be displayed as follows:
## 28 codes from your data successfully matched countries in the map ## 0 codes from your data failed to match with a country code in the map ## 215 codes from the map weren't represented in your data
Assign the axes limits, as follows:
mapCountryData(Map, catMethod = "categorical", missingCountryCol = gray(.8), xlim = c(-20, ...
Read now
Unlock full access