I have a column with tips in my dataframe and will try to run a logistic regression to predict if a tip will be left or now.
Trying to create a boolean column in my data, having 1 and 0, using mutate
. 1
for a tip, 0
for no tip.
My code is pretty simple:
data %>% mutate(ifelse((Tips > 0, 1), ifelse(Tips == 0, 0)))
As an output I have values, which go above 1, for instance, tip = 7.00 converts to boolean value 7, which is not what I expect.
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
What am I missing? Thanks!