Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Automate a R function t [duplicate]

$
0
0

This question already has an answer here:

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


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>