df_right_join Function

public function df_right_join(df1, df2, key_col1, key_col2) result(joined_df)

Perform a right join between two data frames

Returns all rows from right df, with matching rows from left df (or NULL)

@param[in] df1 The left data frame @param[in] df2 The right data frame @param[in] key_col1 Column index for join key in left data frame @param[in] key_col2 Column index for join key in right data frame @return A new data frame with all rows from right and matching rows from left

Arguments

Type IntentOptional Attributes Name
type(data_frame), intent(in) :: df1
type(data_frame), intent(in) :: df2
integer, intent(in) :: key_col1
integer, intent(in) :: key_col2

Return Value type(data_frame)


Source Code

    function df_right_join(df1, df2, key_col1, key_col2) result(joined_df)
        type(data_frame), intent(in) :: df1, df2
        integer, intent(in) :: key_col1, key_col2
        type(data_frame) :: joined_df

        ! Right join is just a left join with arguments swapped
        joined_df = df_left_join(df2, df1, key_col2, key_col1)
    end function df_right_join