library(tidyverse)
<- data.frame(
example_df x1 = c(1, 2, 3),
x2 = c("a", "b", "c"),
x3 = c(5, 1, 2),
y1 = c(0, 9, 2),
y2 = c(2, 7, 9),
z = c(0, 0, 0)
)
example_df
x1 x2 x3 y1 y2 z
1 1 a 5 0 2 0
2 2 b 1 9 7 0
3 3 c 2 2 9 0