library(dplyr)
data(efc)
x1 <- efc %>% select(1:5) %>% slice(1:10)
x2 <- efc %>% select(3:7) %>% slice(11:20)
mydf <- add_rows(x1, x2)
mydf
str(mydf)
if (FALSE) {
library(sjPlot)
view_df(mydf)}
x3 <- efc %>% select(5:9) %>% slice(21:30)
x4 <- efc %>% select(11:14) %>% slice(31:40)
mydf <- add_rows(x1, x2, x3, x4, id = "subsets")
mydf
str(mydf)
Run the code above in your browser using DataLab