samedi 10 août 2019

Looking to satisfy multiple conditions in same column

I'm wanting to figure out how many times a consecutive sequence of events occurred. The issue for me is there are three different types of events that are appropriate and I'm not sure how to integrate them all.

I've tried using a for loop with an if statement but I'm not sure how to fill in the action after the condition.

for (i in DF ) {
  if(event_desc_id=="O" & event_desc_id=="Free Throw"){
  FreeThrow2ndchance <- sum(i) 
  }
ifelse{
  if(event_desc_id=="O" & event_desc_id=="Two Pointer Made")
  TwoPointer2ndChance <- sum(i) 
}

Aucun commentaire:

Enregistrer un commentaire