Skip to content

Add a function for combine/vcat with source names #659

@johnmyleswhite

Description

@johnmyleswhite

Should we add a function like vcat(df1, df2, df3, source = ["X", "Y", "Z"]) which concatenates DataFrames while also labeling their origins? In this example, the output would be equivalent to doing:

df1_alt = copy(df1)
df1_alt[:source] = "X"
df2_alt = copy(df2)
df2_alt[:source] = "Y"
df3_alt = copy(df3)
df3_alt[:source] = "Z"

vcatted = vcat(df1_alt, df2_alt, df3_alt)

The idea is to preserve the semantics of Base.vcat, but allow the introduction of a custom column (whose name comes from a keyword arg) that denotes the origin of each subset of data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions