Skip to contents

Search for variants of a status code (stored in google sheets), create a boolean flag in the dataset, and remove the status qualifier from the title. The flag variable is named SCODE.X (FORMER.X, INTERIM.X, etc.).

In cases where the status is the full title (e.g. 'ex officio') replace the variant with the standardized version and keep it.

Usage

flag_and_remove(
  df,
  title = "TitleTxt6",
  s.code = "FORMER",
  gs_status_codes = NULL
)

Arguments

df

A compensation dataframe

title

Which version of the title string to use (defaults to "TitleTxt6")

s.code

Any of the unique status.qualifier strings from df.status (defaults to "FORMER")

gs_status_codes

Optional status-code crosswalk data frame; if NULL, loaded from the bundled snapshot.

Examples

if (FALSE) { # \dontrun{
x <-
  c( "IMMEDIATE PAST CHAIR",
     "FORMER CEO (EXIT 12/31/17)",
     "PAST PRESIDENT",
     "OUTGOING CEO",
     "PRESIDENT ELECT",
     "BOARD MEMBER (START OCT)",
     "TREASURER - BEGINNING 8/2018",
     "DIRECTOR (AS OF 2/22/18)",
     "INTERIM PRES",
     "ACTING DIRECTOR",
     "PAST INTERIM PRESIDENT" )

remove_date( x )
} # }