#Repeat rows of a data.frame [duplicate]
df <- data.frame(a = 1:2, b = letters[1:2])
df
## a b
## 1 1 a
## 2 2 b
df_1 <-df[rep(seq_len(nrow(df)), each = 2), ]
rownames(df_1) <- NULL
df_1
## a b
## 1 1 a
## 2 1 a
## 3 2 b
## 4 2 b
#ref https://stackoverflow.com/questions/11121385/repeat-rows-of-a-data-frame