Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

transform_data

Transform a data.frame according to the requirements of the model


Description

Transforms specific columns of a data.frame to match the requirements of the standard analysis model.

Usage

transform_data(
  data,
  reference_year,
  female_spec = "F",
  male_spec = "M",
  age_spec = NULL,
  entry_date_spec = NULL
)

Arguments

data

a dataframe object as produced by read_data which is to be transformed

reference_year

a number indicating the reference year of the analysis

female_spec

a string or number indicating the way females are specified in the dataset.

male_spec

a string or number indicating the way males are specified in the dataset

age_spec

a string indicating the age specification, can be one of NULL, "age", "birthyear", or "date_of_birth". If this parameter is set to NULL, the function automatically tries to infers the specification

entry_date_spec

a string indicating the entry_date specification, can be one of NULL, "years", "entry_year", or "entry_date". If this parameter is set to NULL, the function automatically tries to infers the specification


logib

Salary Analysis by the Swiss Federal Office for Gender Equality

v0.1.0
GPL-3
Authors
Jonathan Chassot [aut, cre], Jeremy Kolly [ctb], Federal Office for Gender Equality of Switzerland [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.