scbind {labelr}R Documentation

Safely Combine Data Frames Column-wise

Description

scbind allows one to bind columns together into a data.frame, while preserving any labelr labels of the inputted data.frames.

Usage

scbind(...)

Arguments

...

data.frames to be column-bound

Details

Precedence is given to the labels of earlier-appearing arguments, such that, if both an earlier and a later data.frame include a label attribute with the same name, the attribute from the earlier data.frame will be preserved, and the same-named attribute later data.frame(s) will be discarded.

Value

a data.frame.

Examples

# assign mtcars to df
df <- mtcars

# add value labels to "am"
df <- add_val_labs(
  data = df,
  vars = "am",
  vals = c(0, 1),
  labs = c("automatic", "manual")
)

# add numerical range value labels to "mpg"
df <- add_quant1(df, mpg, qtiles = 4)

df_a <- sselect(df, "am")
df_b <- sselect(df, "mpg")
df_c <- sselect(mtcars, "cyl")
df_all <- scbind(df_a, df_b, df_c)

head(df_all)

get_val_labs(df_all)

[Package labelr version 0.1.5 Index]