df.rbind | R Documentation |
This function takes a sequence of data frames and combines them by rows, while filling in missing
columns with NA
s.
df.rbind(...)
... |
a sequence of data frame to be row bind together. This argument can be a
list of data frames, in which case all other arguments are ignored.
Any |
This is an enhancement to rbind
that adds in columns that are not present in all inputs,
accepts a sequence of data frames, and operates substantially faster.
Column names and types in the output will appear in the order in which they were encountered.
Unordered factor columns will have their levels unified and character data bound with factors will be converted to character. POSIXct data will be converted to be in the same time zone. Array and matrix columns must have identical dimensions after the row count. Aside from these there are no general checks that each column is of consistent data type.
Returns a single data frame
This function is a copy of the rbind.fill()
function in the plyr
package by Hadley Wickham.
Hadley Wickham
Wickham, H. (2011). The split-apply-combine strategy for data analysis. Journal of Statistical Software, 40, 1-29. https://doi.org/10.18637/jss.v040.i01
Wickham, H. (2019). plyr: Tools for Splitting, Applying and Combining Data. R package version 1.8.5.
df.duplicated
, df.merge
,
df.move
,
df.rename
, df.sort
,
df.subset
adat <- data.frame(id = c(1, 2, 3),
a = c(7, 3, 8),
b = c(4, 2, 7))
bdat <- data.frame(id = c(4, 5, 6),
a = c(2, 4, 6),
c = c(4, 2, 7))
cdat <- data.frame(id = c(7, 8, 9),
a = c(1, 4, 6),
d = c(9, 5, 4))
# Example 1
df.rbind(adat, bdat, cdat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.