appenddata: Append data frames by observations

View source: R/data-management.R

appenddataR Documentation

Append data frames by observations

Description

Appends data frames or files below a master data frame. Active data is used as master when available.

Usage

appenddata(
  ...,
  data = NULL,
  source = NULL,
  force = FALSE,
  active = TRUE,
  quiet = FALSE,
  labels = c("factor", "labelled", "numeric")
)

Arguments

...

Data frames or existing file paths to append.

data

Optional explicit master data frame.

source

NULL, TRUE for "_source", or a source-variable name.

force

Logical; convert incompatible columns to character.

active

Logical; replace active data with the result.

quiet

Logical; suppress messages.

labels

Label handling when a file is opened.

Details

Columns are aligned by name. Missing columns are filled with NA. If no active data and no explicit data are supplied, the first object in ... becomes master.

Value

The appended data frame invisibly.

Examples

before <- data.frame(id = 1:2, age = c(20, 30))
after <- data.frame(id = 3:4, age = c(40, 50), sex = c("M", "F"))
usedf(before, quiet = TRUE)
appenddata(after, source = TRUE, quiet = TRUE)
combined <- usedf(quiet = TRUE)
combined2 <- appenddata(before, after, active = FALSE, quiet = TRUE)

R4VN documentation built on Sept. 30, 2026, 5:13 p.m.