I am not very good at R, but I am trying it out to prepare my data for Regression Analysis. So I have three Data frames, and I am trying to add a column to the first dataframe.
Essentially my data is laid out as:
City Neighborhood X Y Z
Euclid N/A
Cleveland Glenville
Mayfield Heights N/A
Euclid N/A
Euclid N/A
Cleveland Clark-Fulton
and I want to add a a column titled: PercentHispanic (it doesn't matter where in the dataframe).
My second dataframe looks like:
City PercentHispanic
Euclid X%
Cleveland Y%
Mayfield Z%
And for the City of Cleveland, my dataframe looks like:
Neighborhood PercentHispanic
Glenville X%
Clark-Fulton Y%
Downtown Z%
How do I add the column PercentHispanic? I want the dataframes to be merge based on City, unless the City is Cleveland, then I want it to merege based on Neighborhood. I do not want to get rid of the N/A values (I want to keep all rows).
Thank you!