Rows: 5275 Columns: 10
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (5): iso2c, iso3c, country, region, income
dbl (5): year, gdp_percap, population, birth_rate, neonat_mortal_rate
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
gdp of each country in trillions of dollars
nations <- nations %>%mutate(gdp_trillions = gdp_percap * population /10^12)
ggplot(filtered_data, aes(x = year, y = gdp_trillions, color = country)) +geom_point() +geom_line() +scale_color_brewer(palette ="Set1") +labs(title ="China's Rise to Become the Largest Economy", x ="Year", y ="GDP ($ trillion)") +theme_minimal()
`summarise()` has grouped output by 'region'. You can override using the
`.groups` argument.
plot 2
ggplot(region_data, aes(x = year, y = sum_GDP, fill = region)) +geom_area(color ="white", size =0.1) +# Thin white line around each areascale_fill_brewer(palette ="Set2") +labs(title ="GDP by World Bank Region", x ="Year", y ="GDP ($ trillion)") +theme_minimal()
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.