Question: I am using R and I need help adding a row with a couple conditionals. I'm analyzing basketball data (basketball knowledge is not necessary to
I am using R and I need help adding a row with a couple conditionals. I'm analyzing basketball data (basketball knowledge is not necessary to solve this problem). Basically on plays where shootingPlay == "TRUE" and type.text== ("JumpShot" or "LayUpShot") and scoringPlay=="TRUE" I want the value in a new row (call it "event.type") to be "make". When shootingPlay == "TRUE" and type.text== ("JumpShot" or "LayUpShot") and scoringPlay=="FALSE" I want the value in the new row to be "miss". For all other rows, I want the value to be NA.
If the logic for the variable type.text== ("JumpShot" or "LayUpShot") makes it more difficult "points>1" should work equally well. The head of the data frame is included below.

# A tibble: 255 x 3 shootingplay points type. text sint>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
