1
I’m on a quest I can’t solve. The problem is this: I have two tables and I need to research if there are equal people in the two tables, in case I need to see how much it earns in the second table and transport to the first (in a new column), but it ends up taking the values 'randomly', below is the code I made:
pensionista.especial <- read.xlsx("PensaoEspecial.xlsx")
pensionista.janeiro <- read.xlsx("PensaoMensal12.xlsx")
pensionista.janeiro <- transform(pensionista.janeiro, PensaoEsp = ifelse(ID.FUNCIONAL %in% pensionista.especial$ID.FUNCIONAL,
1 ,0))
pensionista.janeiro <- transform(pensionista.janeiro, InstEsp = ifelse(ID_FUNCIONAL_INSTITUIDOR %in% pensionista.especial$ID_FUNCIONAL_INSTITUIDOR,
1, 0))
basedetrabalho <- pensionista.janeiro[ , c(1,10,13,14,23,31,32,33,34,69, 78, 79)]
basedetrabalho <- transform(basedetrabalho, VB_ESP = ifelse(ID.FUNCIONAL %in% pensionista.especial$ID.FUNCIONAL, pensionista.especial$VL_BRUTO, 0))
I ask for help with this personal problem!