I'm fairly new to R and have been working to organize and clean my data to prepare for analysis. I'm trying to combine repeated measures data (dataCAL) with one-time initial survey data (dataI) by ID without duplicating the survey data.
I used the following: dataCALc <- dplyr::left_join(dataCAL, dataI, by= "ID")
This joins my data; however, the initial survey data for each ID is copied on multiple rows if there are more than one measurement for that ID in dataCAL. This is useful for some analyses, but problematic for my descriptive stats. I've experimented with filter and distinct in dplyr, but have not yet found a solution.