## construct variables
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 6.159279
2 2 High 9.072112
3 3 High 10.225115
4 4 High 12.991526
5 5 High 16.641695
6 1 Low 6.770141
7 2 Low 8.875500
8 3 Low 12.071153
9 4 Low 14.714911
10 5 Low 17.774427