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.
First graph
Create GDP by using mutate and the given formula
gdp <- nations gdp1 <-mutate(gdp, GDP = (gdp_percap * population) /10^12)
gdp2 <-filter(gdp1, country =="Colombia"| country =="Peru"| country =="Chile"| country =="Uruguay")ggplot(gdp2, aes(x = year, y = GDP, color = country)) +ggtitle("South American countries with their GDP in trillion $") +xlab("year") +ylab("GDP ($ trillion)") +theme_minimal(base_size =12) +geom_point() +geom_line() +scale_color_brewer(palette ='Set1')
Second Chart
For the second graph we will use information from the first one. Also, we will be implementing group_by and summarise.