This question already has an answer here:
- Using If else conditions on Vectors 2 answers
I am trying to put a query in R for all my columns I want to create a new columns that will say impact or non impacted depending of my previous columns info. All Range$X01...to Range$X12 represent my columns tested
my code is a If condition
if (Range$X01=="0" | Range$X02=="0"| Range$X03=="0"| Range$X04=="0" | Range$X05=="0" | Range$X06=="0" | Range$X07=="0" | Range$X08=="0" |Range$X09=="0"| Range$X10=="0"| Range$X11=="0" |Range$X12=="0") {
Range$Status="Impacted"
} else {
Range$Status="Non Impacted"
}
My variables are categorical.
It doesn't seem to be correct