Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
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.
plot_top_4 <- top_4 |>ggplot(aes( x = year, y = gdp, color = country)) +geom_line() +geom_point() +theme_bw() +scale_color_brewer(palette ="Set1") +labs(title ="China's Rise to Become the Largest Economy",y ="GDP ($ trillion)", x ="year",color =NULL) +theme(panel.border =element_blank())plot_top_4
`summarise()` has grouped output by 'region'. You can override using the
`.groups` argument.
plot_regions_gdp <- regions_gdp |>ggplot(aes( x = year , y = sum_GDP, fill = region), ) +geom_area(color ="white") +theme_bw() +scale_fill_brewer(palette ="Set2") +labs(title ="GDP by World Bank Region", x ="year", y ="GDP ($ trillion)" ) +theme(panel.border =element_blank())plot_regions_gdp