I would like to merge 2 data frames based on multiple conditions.
DF1 <- data.frame(\"col1\" = rep(c(\"A\",\"B\"), 18), \"col2\" = rep(c
You can do it in two steps:
final <- merge(DF1,DF2,by=c("col1","col2"),all.x = T) final$data <- ifelse(final$data>=final$min & final$data<=final$max,final$data,"NULL")