My head stands still at the moment. I would like to match/extract data from a larger data.frame (df) based on the columns in a smaller data.frame (mdf). What I\'m getting st
How about merge(df, mdf, all.x = FALSE, all.y = TRUE)?
merge(df, mdf, all.x = FALSE, all.y = TRUE)
Edit: If you have different column names you can specify which ones to merge on, e.g.:
names(mdf) <- c("car_3", "car_4") merge(df, mdf, by.x = c("car_1", "car_2"), by.y = c("car_3", "car_4"), all.x = FALSE, all.y = TRUE)