assign_join: Join two data frames when one might not exist

assign_joinR Documentation

Join two data frames when one might not exist

Description

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.

Usage

assign_col_join(df_1, df_2, by)

assign_row_join(df_1, df_2)

Arguments

df_1

A data frame that might exist

df_2

A data frame to join to df_1

by

If using assign_col_join, Any values to pass to full_join. If none are supplied, glptools::bind_df is used.

Functions

  • 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


greaterlouisvilleproject/glptools documentation built on Feb. 9, 2025, 11:21 a.m.