I\'m trying to combine 2 csv files into one file. They have common id with different size. I used merge() but I got replicated data. I have the following data-frames;
Could you edit your problem and use dput
to put your two df's into a form that would be easier for us to grab?
Having said that, you need to do something like
# NOT RUN
library(tidyverse)
RESULT <- data2 %>%
mutate(comparison.id = str_detect(outcome.id, "^.+\\d+")) %>%
inner_join(data1, by = c("SR.id", "comparison.id"))