After cutting a dataframe, how can a binary field (see desired below) be added such that the value alternates with the cuts?
x cut desired
1.1 (1, 2] 0
1.5 (1, 2] 0
1.6 (1, 2] 0
2.5 (2, 3] 1
3 (2, 3] 1
3.5 (3, 4] 0
3.5 (3, 4] 0
3.7 (3, 4] 0
The goal is to ggplot a histogram with colours similar to this except with only two colours:
(for illustration only - doesn't correspond to above values)