Hi, I am working with ACS data and I have used the dplyr package to filter my data to this. However, I am trying to use mutate within dplyr to find the increase and decrease in total population from 2013 to 2016 based on zip code. for example I want to create a new column that finds for zip 43001 what was the difference in total population from 2013 to 2016
My input:
filterdacs_D1 <- mutate(filename,difference1 =$zip$poulation[population]-$zip$population2017)
But this is incorrect as I want the difference between 2016 and 2014 for each zip code.
Year Zip Total_Population Median_Income City State
1 2013 43001 2475 87333 Alexandria OH
2 2013 43002 2753 83873 Amlin OH
3 2014 43003 2366 46691 Ashley OH
4 2014 43001 24625 70809 Blacklick OH
5 2014 43005 155 43810 Bladensburg OH
6 2015 43006 705 45673 Brinkhaven OH
7 2015 43001 2430 28422 Buckeye Lake OH
8 2016 43009 2036 62188 Cable OH
9 2016 43010 386 34625 Catawba OH
10 2016 43001 7733 66548 Centerburg OH
How do I go about this?