These functions move one column to a new position in a data frame,
either immediately after or before another column, while preserving
the order of all remaining columns. They are lightweight base-R utilities
equivalent to dplyr::relocate(), but without external dependencies.
relocate_after(df, col, after)relocate_before(df, col, before)
A data.frame with columns reordered.
(data.frame) a data.frame whose columns will be reordered.
(character) the name of the column to move.
(character) for relocate_after(): the column after which
col will be placed.
(character) for relocate_before(): the column before which
col will be placed.