## construct variables
set.seed(123)
x <- rep(1:5, times = 2)
g <- gl(n = 2, k = 5, labels = c('High', 'Low'))
y <- 2 + (3 * x) + (as.numeric(g) - 1) + rnorm(10, mean = 0, sd = 1)
## compile into a data frame
dat <- data.frame(x, g, y)
## print out data frame
dat
x g y
1 1 High 4.439524
2 2 High 7.769823
3 3 High 12.558708
4 4 High 14.070508
5 5 High 17.129288
6 1 Low 7.715065
7 2 Low 9.460916
8 3 Low 10.734939
9 4 Low 14.313147
10 5 Low 17.554338