assign_join | R Documentation |
When accumulating data within a loop, you usually have to check whether to create a data frame or bind two data frames together. This function is a shortcut: it checks to see is df_1 exists. If so, it binds the two data frames together as usual. If not, it catches the error and returns df_2.
assign_col_join(df_1, df_2, by)
assign_row_join(df_1, df_2)
df_1 |
A data frame that might exist |
df_2 |
A data frame to join to |
by |
If using |
assign_col_join()
: Joins two data frames column-wise when one might not exist
assign_row_join()
: Joins two data frames row-wise when one might not exist
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.