I have two data sets with common column by the name of "Id", both the data sets have 22099 rows but the number of columns are different. When I use merge() the rows are increased to 15,393,213. Why is this happening. the code is as follows
calories_merged_data <- merge(hourlyCalories_merged, hourlyIntensities_merged, by=c('Id'))
Example of hourlyCalories_merged
| Id | ActivityHour | Calories |
|---|---|---|
| 123 | 4/12/2016 12:00:00 AM | 81 |
| 456 | 5/12/2016 06:00:00 AM | 90 |
Example of hourlyIntensities_merged
| Id | Activityhour | TotalIntensity | AverageIntensity |
|---|---|---|---|
| 123 | 4/12/2016 12:00:00 AM | 20 | 0.33333 |
| 456 | 5/12/2016 06:00:00 AM | 08 | 0.13333 |
The data is from https://www.kaggle.com/arashnic/fitbit