The quick answer, which may be, I am afraid, too specific, may require generalization. Suppose the first dataframe is called "df1":
data.frame (chr = "2L", pos = 1: (150 * NROW (df1)), pval = rep (df1 $ pval, each = 150))
The argument recursion should make "chr" long enough without the rep function.
Change in response to the comment. If the repetition length is always 150, the correction is easy:
data.frame(chr = rep(substr(df1$bins, 1,2), each=150), pos = 1:(150*NROW(df1)), pval = rep(df1$pval, each=150) )
source share