append_column | R Documentation |
Internal function to add a new column to a data frame and optionally position it before or after a specified column.
append_column(.data, new_col, .before = NULL, .after = NULL)
.data |
A data frame to which the column will be added. |
new_col |
A vector containing the values of the new column to append. The name of this vector will be used as the column name in the data frame. |
.before |
(Optional) A string specifying the name of the column before which the new column should be inserted. Defaults to 'NULL'. |
.after |
(Optional) A string specifying the name of the column after which the new column should be inserted. Defaults to 'NULL'. |
If both '.before' and '.after' are provided, '.before' takes precedence. If neither is provided, the new column is appended at the end of the data frame.
The column name is derived from the name of the input vector 'new_col'.
A data frame with the new column added at the specified position or at the end if no position is specified.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.