mapBindAllColumns: mapBindAllColumns()

Description Usage Arguments Value Note Examples

View source: R/helper_functions.R

Description

Table Functions: rbind two data frames x, y and include all columns from both data frame

Usage

1
mapBindAllColumns(x, y, id_col = "")

Arguments

x

(df), if NULL, then return the other df.

y

(df), if NULL, then return the other df.

id_col

[optional] (str) a column that are shared between x and y and must have unique values within each df. If not specified, the row.names of x and y are used for the match

Value

A dataframe that either 1. match the row.names of x and y, and combine the columns from x and y (id_col=”) 2. match the content of id_col, and combine the rest of the columns of x and y

Note

If row.names are not meaningful (default as numerical index) and id_col is not specified, the combined df is not meaningful because the rows are combined based on the numerical order If a column name in y is also in x (except for the id_col), the column name in y is suffixed "_2"

Examples

1
mapBindAllColumns(x, y, id_col = "match_col")

BerylZhuang/helper_functions documentation built on March 15, 2021, 5:19 a.m.