Not able to show data on choropleth map with ggplot2 – R Markdown

Hi everyone,

I am working on some data visualisations for a project. I have very limited experience with R so any help will be greatly appreciated. I have run the code below. I have gotten a map but no colours and Co2 Emission data for the countries.

Co2_Country_Graph4=plot_geo(Co2Country3,
locationmode =”country”,
frame= ~Year)%>%
add_trace(location = ~Country,
z =~Co2_Emissions,
reversescale =T,
color=~Co2_Emissions) %>%
layout(geo = list(showcountries = TRUE, scope=”world”))

Co2_Country_Graph4

My data looks like this.

Read more here: Source link