jeudi 1 octobre 2020

Compare 3 datasets by several variables per row, when match = output matched rows to new matrix

I have three datasets, [10000x27] each. They all have matched data in columns 1-7; each row (columns 1-7) is unique within the dataset but matched across the three datasets.

I want to compare across the datasets, row by row, for variables 1-7. When a row matches across all three datasets I want to output columns 8-27 into a new 3x10 matrix, with one row (columns 8-27)from each dataset.

I am VERY new to R. I am much more familiar with STATA. Logically, I think this needs an If-Then loop with an output function, but I dont even know the first step in R.

Any advice is appreciated. Thank you

Aucun commentaire:

Enregistrer un commentaire