Skip to contents

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.

Usage

add_column(mutate_df, mutate_conditions, col_name)

Arguments

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 mutate_df.

col_name

name of new column to add to mutate_df.

Value

appends a new column to mutate_df.