First post on StackOverflow! I am a beginner at R, and doing several online courses to learn it for data science. I hope you can help me re arrange the format of some data so I can use it for time series analysis and visualisation with ggplot2. I tried search, but it's hard to do a good search when my terminology knowledge is still lacking (I'm not sure of it is data 'manipulation', 'munging', 'wrangling', 'data-cleaning' or something else that I am after).
My data currently looks like this , but want it too look like this. How do I do that in R? Would some package help me?
Note: I don't really mind if the 'net income' and 'year' column are switched. Also, I just used excel to make quick snapshots of the desired dataformat.
Mind you, this dataset continues on and on for ~2000 rows, so whatever code I would use in R, I would need it to work on the huge dataset as well.
thanks!
John