Skip to content

Instantly share code, notes, and snippets.

@DATAUNIRIO
Last active May 8, 2021 18:00
Show Gist options
  • Save DATAUNIRIO/c86c3edffee02f713aa8d7c079580fdc to your computer and use it in GitHub Desktop.
Save DATAUNIRIO/c86c3edffee02f713aa8d7c079580fdc to your computer and use it in GitHub Desktop.
Criação de Índice de Absenteísmo
#-------------------------------------------------------------------------------------------
# Versão 1 - modificado em 08/05/2021 (Thayanne Pinheiro)
#-------------------------------------------------------------------------------------------
# Carregar as bibliotecas
library(janitor)
library(readxl)
library(dplyr)
# Carregar a base de dados e limpar o nome da variavel
ab_adm <- read_excel("~/Downloads/absentismo_adm.xlsx") %>% clean_names()
head(ab_adm)
# Criar o indice absenteismo
ab_adm$soma_absenteismo <- rowSums(ab_adm[,15:33],na.rm = F)
ab_adm$indice_absenteismo<- (ab_adm$soma_absenteismo/19)
# Teste de funcionamento da função criada
summary(ab_adm$indice_absenteismo)
boxplot(indice_absenteismo ~ genero_que_se_identifica, data=ab_adm,col=c("pink",'lightblue'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment