left_join_with_null: Handle a data frame being NULL when merging

left_join_with_nullR Documentation

Handle a data frame being NULL when merging

Description

left_join_with_null does not throw an error if x or y is a NULL. In that case it returns the data frame that is not NULL. If both are NULL, then NULL is returned. This function is based on the left_join function from dplyr package.

Usage

left_join_with_null(x = NULL, y = NULL, by = NULL)

Arguments

x

Data frame

y

Data frame

by

Character vector of common columns for x and y

Details

Used in scripts: Robust function: TRUE

Value

If both x and y is NULL, then NULL is returned. If either x or y is NULL, the non-NULL object is returned. Finally, if both x and y is not NULL, then the merged data frame is returned.


AndreSjuve/dretools documentation built on Dec. 4, 2024, 3:12 a.m.