title: Dataframes in R
body: <p>This is my first time posting, so go easy on me. </p>
  
  <p>I have got the data frame (as shown on the link, I don't have enough rep points to link an image yet). I am trying to run some course wise analysis. Issue is that I have got a few students who are doing dual degrees, and as such need to appear in calculations for both departments. </p>
  
  <p><strong>Dataframe</strong></p>
  
  <p><a href="https://i.stack.imgur.com/AAJqk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AAJqk.png" alt="enter image description here"></a></p>
  
  <p>I am trying to figure out how to do that. </p>
  
  <p>I am think I can write a stopgate statement where syntax checks if the Course2 column is empty or not before doing the analysis for each course. I cannot quite figure out how to do it. </p>
  
  <p>Any help is appreciated. </p>
  
  <p>Thank you. </p>