I have one dataframe (df1) with more than 200 columns containing data (several thousands of rows each). Column names are alphanumeric and all distinct from each other.
I have a second dataset (df2) with a couple of columns where the first column (named 'col1') contains rows with "values" carrying colnames of df1.
But not for every row in df2 I have a corresponding column in df1.
Now I would like to delete (drop) all rows in df2 where there is no "corresponding" column in df1.
I searched quite a while using keywords like "subset data.frame by values from another data.frame" but did not find any solution. I checked, e.g. here, here or here and some other places.
Thanks for your help.