Question: I have a big tibble like this:

```
a b c d e f
1 1 1 0 0 1
4 5 1 1 0 1
3 1 0 0 0 0 

```

And convert it to this (ideally with the tidyverse) so 0s remain while 1 and bigger are converted to 1:

```
a b c d e f 
1 1 1 0 0 1
1 1 1 1 0 1
1 1 0 0 0 0 

```

Variables have distinct names and go form second column to last column.

Thx!

Answer: 
A tidyverse approach could be:

```
library(dplyr)

df %>%
   mutate_all(~ +(.x > 0))

  a b c d e f
1 1 1 1 0 0 1
2 1 1 1 1 0 1
3 1 1 0 0 0 0

```

If you want all but the first column transformed, you could do:

```
df %>%
  mutate_at(vars(-1), ~ +(.x > 0))

```
You can use `pmin` which will select minimum between the 1 and the value in the dataframe.

```
pmin(df, 1)

#  a b c d e f
#1 1 1 1 0 0 1
#2 1 1 1 1 0 1
#3 1 1 0 0 0 0

```

**data**

```
df <- structure(list(a = c(1L, 4L, 3L), b = c(1L, 5L, 1L), c = c(1L, 
1L, 0L), d = c(0L, 1L, 0L), e = c(0L, 0L, 0L), f = c(1L, 1L, 
0L)), class = "data.frame", row.names = c(NA, -3L))

```