How to calculate slope with conditions in r

Sorry, I have no idea, if you could make a REPRoducible EXample (reprex) about this, we could take a look and try to help. To get sample data that better represents the structure of your actual dataframe try using dput() function (as explained in the reprex link).

1 Like