Here I was using 2 datasets "dailyActivity_merged" and "sleepDay_merged" which had column names "ActivityDate" and "SleepDay" which had inputs of data in them, so i wanted to merge these datasets together by "Id" and "Date" after renaming the respective columns as "Date" as shown in the following code:
rename(dailyActivity_merged,Date=Avtivitydate)
rename(sleepDay_merged,Date=SleepDay)
merge(dailyActivity_merged,sleepDay_merged,by=c("Id","Date"),all.x=TRUE)
But I kept getting the following error:
Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
I initially thought it was because of some inconsistency in "Id" but that was not the case as I ran the merge function without "Date" and it was running. If anyone could guide me here I would be grateful.