Hi,

I have two data frames, both containing the columns `GeneName` and `logFC`.

Using `intersect()`, I have obtained the common genes between the two. I want to know how to merge my two dataframes based on the common dataframe.

Thank you.
**1. Get common column names**

    common_column_names <- intersect(names(dataframe_1), names(dataframe_2))

**2. Use this character vector as your `by` parameters in the `merge` function.**

    merge(dataframe_1, dataframe_2, by=common_column_names, all.dataframe_1=TRUE)

** P.S - Your title of the question should be "How to merge 2 dataframes based on common column names?" I have edited the title.