Learn R Programming

cayleyR (version 0.2.1)

add_state_keys: Add State Keys to Data Frame

Description

Computes paste-based state keys for V-columns and adds a state_key column. If keys already exist, only computes for new rows.

Usage

add_state_keys(states_df, new_states, v_cols)

Value

Data frame with state_key column

Arguments

states_df

Data frame

new_states

Data frame of newly added states (used when state_key column already exists to compute keys only for new rows)

v_cols

Character vector of V-column names