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

replace Yes, No to 1, 0 in multiple columns in r

$
0
0

I need to replace the Yes and No values to 1 and 0 in 200 columns.

I was using with the command

data %>% mutate(x=ifelse(x=="Yes", 1,0))

but i have to go through each column at a time, and i was wondering if there was any way i could do it all at once.


Viewing all articles
Browse latest Browse all 201839

Trending Articles



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