I'm looking for a line of code that will allow me to extract a column of the same name from multiple data frames and cbind them into a single dataframe. I'm also looking to name each column in the new dataframe after the dataframe it came from.
Below is the code I've been using with reproducible data. I've been trying do.call however I can't get it to work:
Asset <- structure(c(63.281303433027, 63.3979720475464, 63.6714334032718,
62.9559893597375, 63.0078420773017, 62.8893215800121, 31.6989860237732,
31.8357167016359, 31.4779946798687, 31.5039210386508, 31.4446607900061,
31.0492838185792, 63.3979720475464, 63.6714334032718, 62.9559893597375,
63.0078420773017, 62.8893215800121, 62.0985676371584),
class = c("xts","zoo"), .indexCLASS = "Date", .indexTZ = "UTC", tclass = "Date", tzone = "UTC",
index = structure(c(1550534400, 1550620800, 1550707200, 1550793600, 1551052800, 1551139200),tzone = "UTC", tclass = "Date"), .Dim = c(6L, 3L),
.Dimnames = list(NULL, c("Beginning.Value", "Unit.Price", "Ending.Value")))
Register<- structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212.156319855224,
213.718845942538, 211.63547782612, 211.809091835821, 211.63547782612,
207.989583622389),
class = c("xts", "zoo"), .indexCLASS = "Date", .indexTZ = "UTC", tclass = "Date", tzone = "UTC",
index = structure(c(1550534400,1550620800, 1550707200, 1550793600, 1551052800, 1551139200), tzone = "UTC", tclass = "Date"), .Dim = c(6L, 3L),
.Dimnames = list(NULL, c("Amount", "Taxes", "Ending.Value")))
Ledger<- structure(c(0.994402284972246, 1.00685740995534, 0.991497559782253,
1.00156143848816, 1.00071020618011, 0.995451606923588, 161.592601088027,
160.688051756542, 161.789955602362, 160.414346177021, 160.664823311196,
160.778928461638, 160.688051756542, 161.789955602362, 160.414346177021,
160.664823311196, 160.778928461638, 160.04764269659), class = c("xts", "zoo"), .indexCLASS = "Date", .indexTZ = "UTC", tclass = "Date", tzone = "UTC",
index = structure(c(1550534400, 1550620800, 1550707200, 1550793600, 1551052800, 1551139200), tzone = "UTC", tclass = "Date"), .Dim = c(6L, 3L),
.Dimnames = list(NULL, c("Discount_Proxy", "Beginning.Value","Ending.Value")))
dfs <- data.frame(c("Ledger","Registry","Ledger"))
names(dfs) <- "Data Frame"
Values <- do.call('cbind', list(dfs[,1]$Ending.Value))