View source: R/fct_add_column.R
add_column | R Documentation |
Add a column to a (spatial -
sf) data frame using dplyr's
mutate function. The values of the new column will be computed
by applying operations to values in existing columns. For example,
new_column = old_column > 30
will create a new column
new_column
of type LOGICAL with values of TRUE
where
old_column
is greater than 30.
add_column(mutate_df, mutate_conditions, col_name)
mutate_df |
a (spatial - sf) data frame to add a column to using dplyr's mutate function. |
mutate_conditions |
a single element character vector of operations used
to compute values for the new column based on values of existing columns in
|
col_name |
name of new column to add to |
appends a new column to mutate_df
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.