r - cbind different length of data frames based on column -


i have 2 dataframes:

df1 name stock_1 stock_2      11      12 b       9       2 c       1       3  df2 name stock_1 d     2 e     4 

expected output:

 name stock_1 stock_2          11      12     b       9       2     c       1       3     d     2        na     e     4        na 

the name , stock_1 names of columns. try cbind 2 df not working. there efficient way?

we use dplyr::full_join() :

library(dplyr) df3 <- full_join(df1, df2) df3   name stock_1 stock_2 1         11      12 2    b       9       2 3    c       1       3 4    d       2      na 5    e       4      na 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -