I'm trying to make a scatterplot of my panel dataset, which is structured as follows:
| country | year | variable | value |
|---|---|---|---|
| A | 2010 | 1 | ... |
| B | 2010 | 1 | ... |
| C | 2010 | 1 | ... |
| A | 2011 | 2 | ... |
| ... |
I want to scatterplot e.g. variable 1 vs. variable 2 for every country for which in a given year, there's data (value) on both variables.
Any suggestions on how to set the aes(x,y) in ggplot?
Thanks a lot!