Skip to contents

This function takes a character vector of model codes and simplifies them by combining adjacent 'R' and 'L' suffixes for the same base letter (G, F, or P) into a single 'RL'. It also applies established names for specific restrictions.

Usage

rename_model_code(codes)

Arguments

codes

Character vector of model restrictions to rename.

Value

A named character vector where the original restrictions are the names and the simplified names are the values.

Examples

rename_model_code(c("GRGL", "GRFRPR", "GRGLFRFLPRPL"))
#>         GRGL       GRFRPR GRGLFRFLPRPL 
#>        "GRL"        "EER"        "GDR"