Good evening! I need to stack several dataframes into one large data frame. Could somebody give ideas about how going around this?
Thanks anticipated!
Jesus
You can do this with the rbind() function in base R or the bind_rows function from the dplyr package.
df1 <- data.frame(A = 1:3, B = 11:13)
df2 <- data.frame(A = 4:6, B = 14:16)
df3 <- data.frame(A = 7:9, B = 17:19)
AllDat <- rbind(df1, df2, df3)
AllDat
#> A B
#> 1 1 11
#> 2 2 12
#> 3 3 13
#> 4 4 14
#> 5 5 15
#> 6 6 16
#> 7 7 17
#> 8 8 18
#> 9 9 19
Created on 2023-03-08 with reprex v2.0.2
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.