add_group_id: Helper function to add group ID information

Description Usage Arguments Value Examples

View source: R/add-group-id.R

Description

Some modelling software needs group data as an index. This means instead of c("AU", "AU", "UK", "UK", "NZ") you need c(1, 1, 2, 2, 3), corresponding to each of the groups. This function makes it simpler to add that information to a dataframe.

Usage

1

Arguments

.data

data.frame

group

group to add the ID for

Value

data.frame with additional column named ".group_id", where "group" is named after the variable you would like to add the group ID for.

Examples

1

njtierney/yahtsee documentation built on Feb. 5, 2022, 8:25 p.m.