I am trying to match strings in a column of a data frame with the strings in a column of another data frame and map the corresponding values. The number of rows are different for both data frames
df1 = data.frame(name = c("(CKMB)Creatinine Kinase Muscle & Brain", "24 Hours Urine for Sodium", "Antistreptolysin O Titer", "Blood group O", lonic_code = c("27816-8-O", "27816-8-B", "1869-7", "33914-3")
df2 = data.frame(Testcomponents = c("creatinine", "blood", "potassium"))
Expected output
Test Components lonic_code
creatinine 27816-8-O
blood 1869-7
potassium NA