I have a dataframe that looks like below.
ID number is the person's ID, position is their job position, Dt_Alter is the date when they changed role and Education is their background.
I need to calculate their average time in position (until they get to the manager position) and also how many times they changed role until they get to manager.
Any tips I appreciate as I am new to R
and having a hard time at this part of the analysis. The dataframe is huge.
ID Number Position Dt_Alter Education
2 MANAGER 2019-02-01 BUSINESS, MANAGEMENT AND ADMINISTRATION
2 COORDINATOR 2019-01-01 BUSINESS, MANAGEMENT AND ADMINISTRATION
2000261 MANAGER 2018-12-01 BUSINESS, MANAGEMENT AND ADMINISTRATION
2000261 SUPERVISOR 2016-12-01 BUSINESS, MANAGEMENT AND ADMINISTRATION
2000553 MANAGER 2018-12-01 ENGINEERING
2000553 COORDINATOR 2016-04-01 ENGINEERING
structure(list(Matricula = c(2L, 2L, 2L, 2L, 2L),
Desc2 = c("GERENTE", "COORDENADOR SEGUROS", "COORDENADOR SEGUROS", "COORDENADOR SEGUROS", "COORDENADOR SEGUROS"),
Dt_Alteracao = c("01/02/2019", "01/01/2019", "01/01/2018", "01/09/2017", "01/09/2016"),
Education = c("BUSINESS, MANAGEMENT AND ADMINISTRATION", "BUSINESS, MANAGEMENT AND ADMINISTRATION", "BUSINESS, MANAGEMENT AND ADMINISTRATION", "BUSINESS, MANAGEMENT AND ADMINISTRATION", "BUSINESS, MANAGEMENT AND ADMINISTRATION")),
row.names = c("2.10823", "2.10824", "2.10825", "2.10826", "2.10827"), class = "data.frame")