I have a data frame as df1 which contains a column of the name of the university as University_name and has 500000 number of rows. Now I have another data frame as df2 which contains 2 columns as university_name and university_aliases and has 150 rows. Now I want to match each university alias present in the university_aliases column with university names present in university_name_new.
a sample of df1$university_name
university of auckland
the university of auckland
university of warwick - warwick business school
unv of warwick
seneca college of applied arts and technology
seneca college
univ of auckland
sample of df2
University_Alias Univeristy_Name_new
univ of auckland university of auckland
universiry of auckland university of auckland
auckland university university of auckland
university of auckland university of auckland
warwick university university of warwick
warwick univercity university of warwick
university of warwick university of warwick
seneca college seneca college
unv of warwick university of warwick
I am expecting output like this
university of auckland
university of auckland
university of warwick
seneca college
seneca college
and I am using the following code but it is not working
df$university_name[ grepl(df$university_name,df2$university_alias)] <- df2$university_name_new