I am working on some data manipulation practice and have hit a stumble with the data that I am trying to emulate. From the Gapminder data I am ultimately wanting to have my data represent the Americas, with new columns for gdp_2002 and gdp_2007. I know how to do calculation to receive a column similar to gdp_change, but am stuck:
## # A tibble: 25 x 4
## country year_1997 year_2007 gdp_change
## <fct> <dbl> <dbl> <dbl>
## 1 Argentina 10967. 12779. 16.5
## 2 Bolivia 3326. 3822. 14.9
## 3 Brazil 7958. 9066. 13.9
## 4 Canada 28955. 36319. 25.4
## 5 Chile 10118. 13172. 30.2
## 6 Colombia 6117. 7007. 14.5
## 7 Costa Rica 6677. 9645. 44.5
## 8 Cuba 5432. 8948. 64.7
## 9 Dominican Republic 3614. 6025. 66.7
## 10 Ecuador 7429. 6873. -7.49
## # ... with 15 more rows
And what I have so far is below, though I'm not sure these are correct steps. Essentially, I want to manipulate the data so I have a column that has all 2002 gdp values and all 2007 gdp values. Any help or suggestions on this kind of manipulation would be appreciated! Thanks!