Append Empty Columns
append_empty_col.Rd
Appends empty columns (value = NA
) to a data.frame.
Arguments
- df
A data.frame.
- col
The name(s) of one or more columns desired in the final data.frame, as a character vector. Any names not currently in the data.frame will be added as empty columns; those present will remain unchanged.
- order
Whether to reorder the data.frame to match the order of
col
, as a boolean (default:FALSE
). IfFALSE
empty columns are added to the right. Whenorder = TRUE
,col
is used to specify column order. Thus, in addition to the names of the empty columns to append,col
must include all column names indf
.append_empty_col()
will not subset/select columns.