I want to create a dummy where all cells that include NA become 1 and all other cells -1. I tried to different things both not resulting in my desired outcome.
1) This leads to only NA Values.
Cox.Reg$FirstTask <- ifelse(Cox.Reg$active_task_avg_depth == NA, 1, -1)
2) This leads to only the -1 values being shown in the new column.
Cox.Reg$FirstTask <- ifelse(Cox.Reg$active_task_avg_depth == "NA", 1, -1)