Loss of values with dplyr left_join

Hi All,

Here I am, again with 2 questions.

My problem: I am merging 6 datasets with dplyr left-join.
These are datasets Eating, Ruminating, Lying, LegActivity, LegInActivity, and KetosisCalcium.

However, when merging, ALL the data of the Calcium and Ketosis columns disappear when the Column 'Lactation' is more than 1. So every cow that is in lactation 2 or up suddenly doesn't have Calcium or Ketosis values anymore, which it should have. In the pictures below, you can see that the dataset KetosisCalcium does have values in columns Calcium and Ketosis for all of the different lactations (column 'Lactation'). KetosisCalciumLong$Calcium has 327 and KetosisCalciumLong$Ketosis has 1408 values, all over different lactations.
In the other photo, you can also clearly see that in DfAllDataLong, for $Ketosis there are still values up to lactation 1, then they disappear. For $Calcium there are more NA's, as there were far less measurements taken, so the seen NA's in Lactation 1 can still be proper / good / not wrong. We specifically see NO values vor $Calcium or $Ketosis anymore after we hit the Lactation 2 bump...


image

Second, YES I would LOVE to make a Reprex, but I don't know how to do it. I have been trying this for hours and hours, not for the day today either, but I keep on getting errors. And YES I really did read through the make a Reprex for dummies helpdesks, and I have seen a lot of YT videos on how to make a Reprex too, but I keep on getting errors. I need to download more packages and everytime I click Yes for install, it doesn't work again.

I do however have it all online in GitHub and I would be more than willing to send emails with the data and the script, and then I could easily direct to the line numbers where it goes wrong.

Maybe there is someone (Dutch?) who can help me with for example TeamViewer or Teams Screen sharing to install reprex? I would be MORE than willing, as this is a problem I keep on running into but doesnt work, no matter how much I tried.

That having said, I am not good in R Studio, and I have hard time understanding explanations in die-hard programmer language as well, I hope you understand and can help me anyways

Thanks in advance!

I can't help you with your code problem but maybe I can help you with getting a reprex to work. The dialog titled Install Required Packages has caused me problems in the past. I suggest you note the names of the packages and use the menu Tools -> Install Packages.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.