Skip to contents

Build a CatMapper-compatible key column from one or more source columns using the FIELD == VALUE expression format, joined by && per row.

Usage

build_key_from_columns(data, columns, key_column = "Key", drop_source = FALSE)

Arguments

data

Data frame containing source key columns.

columns

Character vector of source column names to include in the key.

key_column

Name of the output key column. Defaults to Key.

drop_source

If TRUE, remove source key columns after creating the output key column.

Value

A data frame with the generated key column.

Examples

rows <- data.frame(Type = "Adamana Brown", Region = "Flagstaff", stringsAsFactors = FALSE)
build_key_from_columns(rows, c("Type", "Region"))
#>            Type    Region                                          Key
#> 1 Adamana Brown Flagstaff Type == Adamana Brown && Region == Flagstaff