I’m trying to combine information from 3 different datasets (gonadosomatic indices, larval counts, and qPCR gene copy values) with common columns of Year, Week, Site, and Type (specifying sampling events). The datasets have approximately 4k, 50, and 500 rows in each, respectively. For each Year, Week, Site, and Type specification, the GSI data consists of 20 different data points, the plankton data consists of 1 data point, and the gene copy values are 12 data points. My plankton data also does not join with the other two.
I first left-joined the GSI and gene copy data because they were the larger datasets and then I joined the larval data to this using another left join. I was expecting these to combine and the GSI values not to repeat but rather the extra rows with no gene copy value to match with the remaining GSIs to receive an NA. However, When I combine these datasets, some of the GSI and larval values get repeated when they get matched up with a gene copy value that has 4 replicates. So, I go from 20 GSI data points to 68 data points, or from 1 larval count to 12 larval counts for each sampling event. Granted, the additional GSI and larval data is repeated, but it’s messing with things obviously! I get the many-to-many warning, which also describes the issue…I don’t want to have the many to many issue 🙂
I need to evaluate all of this data for normality, most likely transform it, and then run regressions to understand the relationships between the three.
GCPleft <- left_join(GC, Plankton, by = c("Year", "Week", "Site", "Type"))
Warning message:
In left_join(GSI, Copies, Plankton, by = c("Year", "Week", "Site", :
Detected an unexpected many-to-many relationship between `x`
and `y`.
ℹ Row 138 of `x` matches multiple rows in `y`.
ℹ Row 260 of `y` matches multiple rows in `x`.
ℹ If a many-to-many relationship is expected, set `relationship
= "many-to-many"` to silence this warning.
Phoebe Jekielek is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.