How to merge 3 dataframes by id in R

r
data_wrangling

#1

I have 3 dataframes(contacts, bookings,tickets).

merged.data <- merge(contacts, bookings,tickets, by=c(“contact_id”, “booking_id”,“ticket_id”))

While merging data frame ,getting below error message.

Error in fix.by(by.x, x) :
‘by’ must specify one or more columns as numbers, names or logical


#2

total_data <- merge(contacts, bookings, by=“contact_id”,all=TRUE)
new_data <- merge(total_data, tickets, by=“contact_id”,all=TRUE)

It is working fine.