Is it possible to row bind two data frames that don't have the same set of columns? I am hoping to retain the columns that do not match after the bind.
相关问题
- R - Quantstart: Testing Strategy on Multiple Equit
- How to remove spaces in between characters without
- Using predict with svyglm
- Reshape matrix by rows
- Extract P-Values from Dunnett Test into a Table by
相关文章
- How to convert summary output to a data frame?
- How to plot smoother curves in R
- Paste all possible diagonals of an n*n matrix or d
- ess-rdired: I get this error “no ESS process is as
- How to use doMC under Windows or alternative paral
- dyLimit for limited time in Dygraphs
- Saving state of Shiny app to be restored later
- How to apply multiple functions to a groupby objec
You could also just pull out the common column names.
An alternative with
data.table
:rbind
will also work indata.table
as long as the objects are converted todata.table
objects, sowill also work in this situation. This can be preferable when you have a couple of data.tables and don't want to construct a list.
rbind.fill
from the packageplyr
might be what you are looking for.You can use
smartbind
from thegtools
package.Example:
If the columns in df1 is a subset of those in df2 (by column names):