I am having problem with multiple conditions in R. My data is like this:
Region in UK Year Third column (year.city) Liverpool 2008
Manchester 2010 Liverpool 2016 Chester 2015 Birmingham 2016 Blackpool 2012 Birmingham 2005 Chester 2009 Liverpool 2005 Hull 2011 Leeds 2013 Liverpool 2014 Bradford 2008 London 2010 Coventry 2009 Cardiff 2016 Liverpool 2007
What I want to create is a third column in a way that it has for groups in it: Liverpool before 2010, Liverpool after 2010, Other cities before 2010, other cities after 2010. I tried couple of codes like mutate but could not solve it. May you please help me to do it? Thanks
Aucun commentaire:
Enregistrer un commentaire