I have a data set like
Student_ID City Branch Name_of_University
M2001 Hyderabad C.S.E JNTU
M2002 Delhi E.C.E DelhiUniversity
M2003 Hyderabad C.S.E
M2004 Chennai I.T
M2005 Chennai C.S.E AnnaUniversity
M2006 Hyderabad E.C.E OU
M2007 Delhi I.T
M2008 Chennai E.C.E
I would like to fill the missing values of Name_University based on city, say M2003 can be filled with either OU or JNTU , but if JNTU appears more than OU, it is better to fill with JNTU. So how can i decide University name based on Maximum number of occurrences corresponding to a city.
I need to do this in R. Please help me!