I'm appending multiple data frames into a larger dataframe using rbind. I would like to add the name of the data frame as a new column, "name".
n = c(2, 3, 5)
s = c("aa", "bb", "cc")
d1 = data.frame(n, s)
n = c(2, 3, 5)
s = c("ax", "bx", "cx")
d2 = data.frame(n, s)
rbind(d1, d2)
I'd like to see a new column with "d1" and "d2" as variables. I'm doing it on lots of datasets so eventhough this example is simple the final prdoct will save me a bunch of time. Thx