Join matching values from x to y

# Create sample data frames
x <- data.frame(ID = c(1, 2, 3), value = c("A", "B", "C"))
y <- data.frame(ID = c(2, 3, 4), result = c("Yes", "No", "Yes"))

# Inner join based on matching ID
merged_data <- merge(x, y, by = "ID", all = FALSE)
merged_data