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.
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.
Geom_point and Geom_line
#filter databig4 <- nations |>filter(iso3c %in%c("CHN","DEU", "JPN", "USA")) |>arrange(year)#Make basic chartnations_chart <-ggplot(big4, aes(x = year, y = gdp_tn, group = country)) +labs(title ="China's Rise to Become the Largest Economy") +xlab("Year") +ylab("GDP ($ trillion)") +theme_minimal(base_size =14)
`summarise()` has regrouped the output.
ℹ Summaries were computed grouped by year and region.
ℹ Output is grouped by year.
ℹ Use `summarise(.groups = "drop_last")` to silence this message.
ℹ Use `summarise(.by = c(year, region))` for per-operation grouping
(`?dplyr::dplyr_by`) instead.
#plot area chartarea <- regions |>ggplot(aes(x = year, y = gdp_tn)) +theme_bw() +labs(title ="GDP by World Bank Region",y ="GDP ($ trillion)",x ="year") +geom_area(aes(fill = region), color ="white") +scale_color_brewer(palette ="Set2") +labs(fill ="region")area