Here is an example data for reproducibility:
pop year type value
pop3 1980 prev 1.42
pop4 1988 prev 1.53
pop6 1981 prev 1.42
pop8 1980 prev 1.7
pop3 1980 pops 977
pop4 1988 pops 822
pop6 1981 pops 1028
pop8 1980 pops 935
I want to change my data.frame
using basic commands from dplyr
and tidyr
(preferably w/o using df function) into a data.frame
that looks like this:
pop year prev pops
pop3 1980 1.42 977
pop4 1988 1.53 822
pop6 1981 1.42 1028
pop8 1980 1.70 935
Any kind of suggestions are welcomed.