##1. Demand Trends Over Time by Material and Technology:ggplot(ev_data_long, aes(x = Year, y = Demand, color = Material, shape = Technology)) +geom_point() +# Changed from geom_line() to geom_point()scale_color_manual(values =c("Copper"="#FF5733", "Cobalt"="#3498DB")) +labs(title ="Demand Trends Over Time by Material and Technology",x ="Year",y ="Demand (Metric Tons)",color ="Material",shape ="Technology") +# Changed from linetype to shape for clarity in a point plottheme_minimal()
####2. Changes in the demand for copper and cobalt under different policy scenarios over timeggplot(ev_data_long, aes(x = Year, y = Demand, color = Scenario)) +geom_line() +facet_wrap(~Technology, scales ='free_y') +labs(title ="Demand for Copper and Cobalt Over Time by Policy Scenario",x ="Year", y ="Demand (metric tons)",color ="Policy Scenario") +theme_minimal() +scale_color_manual(values =c("Stated policies scenario"="blue","Announced pledges scenario"="red","Net Zero Emissions by 2050 scenario"="green"))
# 3. Different technology sceneriesggplot(ev_data_long, aes(x = Year, y = Demand, fill = Technology)) +geom_area(position ='stack') +facet_wrap(~Scenario, scales ='free_y') +labs(title ="Demand by Technology Scenario",x ="Year", y ="Demand (metric tons)",fill ="Technology Scenario") +theme_minimal() +scale_fill_brewer(palette ="Set2")
# 4. Demand Difference by Scenario and Technologyggplot(ev_data_long, aes(x = Technology, y = Demand, fill = Scenario)) +geom_bar(stat ="identity", position ="dodge") +facet_wrap(~Year, scales ='free_y') +labs(title ="Demand Difference by Scenario and Technology",x ="Technology", y ="Demand (metric tons)",fill ="Policy Scenario") +theme_minimal() +scale_fill_manual(values =c("Stated policies scenario"="blue","Announced pledges scenario"="red","Net Zero Emissions by 2050 scenario"="green"))
`summarise()` has grouped output by 'Year'. You can override using the
`.groups` argument.
ggplot(ev_data_cumulative, aes(x = Year, y = Total_Demand, fill = Scenario)) +geom_bar(stat ="identity") +labs(title ="Cumulative Demand Analysis",x ="Year", y ="Total Demand (metric tons)",fill ="Policy Scenario") +theme_minimal() +scale_fill_manual(values =c("Stated policies scenario"="blue","Announced pledges scenario"="red","Net Zero Emissions by 2050 scenario"="green"))
##6. Combined Impact of Technology and Policy Scenarios on Copper and Cobalt Demandev_data_long %>%group_by(Year, Technology, Scenario) %>%summarise(Total_Demand =sum(Demand, na.rm =TRUE)) %>%ggplot(aes(x = Year, y = Total_Demand, color = Technology)) +geom_line() +facet_grid(Scenario ~ .) +labs(title ="Combined Impact of Technology and Policy Scenarios on Copper and Cobalt Demand",x ="Year", y ="Total Demand (metric tons)",color ="Technology") +theme_minimal()
`summarise()` has grouped output by 'Year', 'Technology'. You can override
using the `.groups` argument.
##Comparison of Copper and Cobalt Demand Across Policy Scenariosev_data_summary <- ev_data_long %>%group_by(Year, Scenario) %>%summarise(Total_Demand =sum(Demand, na.rm =TRUE), .groups ='drop') ggplot(ev_data_summary, aes(x = Year, y = Total_Demand, fill = Scenario)) +geom_bar(stat ="identity", position ="dodge") +labs(title ="Comparison of Copper and Cobalt Demand Across Policy Scenarios",x ="Year", y ="Total Demand (metric tons)",fill ="Policy Scenario") +theme_minimal() +scale_fill_manual(values =c("Stated policies scenario"="blue","Announced pledges scenario"="red","Net Zero Emissions by 2050 scenario"="green"))