I am having a column that is having the tips and will try to build a logistic regression model to predict if a tip will be left or now.
I have created a boolean column in my data, having 1 and 0, using mutate() function:
1 for a tip, 0 for no tip.
My code is pretty simple:
data %>% mutate(ifelse((Tips > 0, 1), ifelse(Tips == 0, 0)))
I have values, which will go above 1, for example, tip = 7.00 converts to boolean value 7, which is not what I anticipate.
Tips boolean
1.75 1
2.00 2
0.00 0
2.35 2
0.00 0
1.00 1
0.00 0
0.00 0
7.00 7
0.00 0