In this Readme you can find an overview explanation for each used script by the quality team till “1-Oct-2020” with a brief description of fixed errors and added features and these scripts are as follows:
This Script is a small one (only 4 lines of code) used to include gmail library and gmail audthentication, and it is run before using any script that sends emails. After running it, you will be asked to choose the e-mail you wish to send from
use_secret_file("E-mail_access.json")
gm_auth_configure(path = "E-mail_access.json")
gm_token()
This Script is one of the main used scripts that uses HR employees list and make many changes to it and generates at the end a CSV file called “Emplyees.csv” that is used in many other scripts.
These changes are mainly as follows:
Employees<-read.csv("SIVI _ Synopsys HR list_25_Sep 2020.csv", colClasses = "character")
Employees <- Employees %>% slice(-c(1:8))
Employees <- subset(Employees, select = -c(1:2,4,6,8,9,14:40))
Employees$X.11 = paste(Employees$X.11,"",Employees$X.6)
Employees <- subset(Employees, select = -c(3) )
Employees<- Employees %>% filter(Info.Update != "")
Employees$Reporting.To<- gsub("(^\\s+)|(\\s+$)", "", Employees$Reporting.To )
Employees$Name<-gsub("(^\\s+)|(\\s+$)", "", Employees$Name )
Employees$Email.ID<-gsub("(^\\s+)|(\\s+$)", "", Employees$Email.ID )
Employees$Title<-gsub("(^\\s+)|(\\s+$)", "", Employees$Title )
#ADD Extra fields mail of m+1 and m+2
Employees$Mail.M.1=""
Employees$Mail.M.2=""
Employees$title="Individual"
# Filling M+1 and M+2 fields
for(i in 1:nrow(Employees)){for(j in 1:nrow(Employees)){if(Employees[i,]$Name==Employees[j,]$Reporting.To){Employees[j,]$Mail.M.1= Employees[i,]$Email.ID}}}
for(i in 1:nrow(Employees)){for(j in 1:nrow(Employees)){if(Employees[i,]$Name==Employees[j,]$Reporting.To){Employees[j,]$Mail.M.2= Employees[i,]$Mail.M.1}}}
# Edit names that have different representation
Employees$Name <- ifelse(Employees$Name!="Ahmed Gamal",Employees$Name,Employees$Name<-"Ahmed Gamal (agamal)")
Employees$Name <- ifelse(Employees$Name!="Ahmed Hamed",Employees$Name,Employees$Name<-"Ahmed Hamed (ahamed)")
Employees$Name <- ifelse(Employees$Name!="Mark George",Employees$Name,Employees$Name<-"Mark George (markge)")
Employees$Name <- ifelse(Employees$Name!="Mahmoud Wafa",Employees$Name,Employees$Name<-"Mahmoud Wafa (wafa)")
Employees$Name <- ifelse(Employees$Name!="Esraa Hamed",Employees$Name,Employees$Name<-"Esraa Hamed (esraah)")
Employees$Name <- ifelse(Employees$Name!="Hany Salah",Employees$Name,Employees$Name<-"Hany Salah (hsalah)")
Employees$Name <- ifelse(Employees$Name!="Ahmed Taha",Employees$Name,Employees$Name<-"Ahmed Taha (taha)")
Employees$Name <- ifelse(Employees$Name!="Ahmed Hany",Employees$Name,Employees$Name<-"Ahmed Hany (ahany)")
Employees$Name <- ifelse(Employees$Name!="Omar Khaled",Employees$Name,Employees$Name<-"Omar Khaled (okhaled)")
Employees$Name <- ifelse(Employees$Name!="Mohamed Fouad",Employees$Name,Employees$Name<-"Mohamed Fouad (mohamedf)")
Employees$Name <- ifelse(Employees$Name!="Sherouk eladly",Employees$Name,Employees$Name<-"Sherouk Eladly")
Employees$Name <- ifelse(Employees$Name!="Ahmed Elhemeily",Employees$Name,Employees$Name<-"Ahmed ElHemeily")
Employees$Name <- ifelse(Employees$Name!="Shaimaa El Badry",Employees$Name,Employees$Name<-"Shaimaa Elbadry")
#Edit names that have different representation in Reporting.To field
Employees$Reporting.To <- ifelse(Employees$Reporting.T!="Abdelrahman Eltawila",Employees$Reporting.To,Employees$Reporting.To<-"AbdelRahman ElTawila")
Employees$Reporting.To <- ifelse(Employees$Reporting.T!="Shaimaa El Badry",Employees$Reporting.To,Employees$Reporting.To<-"Shaimaa Elbadry")
#Cases that have different reporter
for(i in 1:nrow(Employees))
{
if(Employees[i,]$Name=="Ahmed Abbas")
{
Employees[i,]$Reporting.To= "Mahmoud Koryem"
Employees[i,]$Mail.M.1= "mahmoud.korayem@si-vision.com"
}
if(Employees[i,]$Name=="Mohamed Mekawy")
{
Employees[i,]$Reporting.To= "Mahmoud Koryem"
Employees[i,]$Mail.M.1= "mahmoud.korayem@si-vision.com"
}
}
# Define Different roles in Si-vision title field
Employees$title <- ifelse(!Employees$Title == "Expert" & !Employees$Title == "Expert Plus" ,Employees$title,Employees$title<-"Staff&Above")
#Define-seniors in si-vision
Employees$title <- ifelse(!Employees$Title == "Senior",Employees$title,Employees$title<-"Senior")
This is the second version of the script in this version:
This script is used for determining the employees that don’t perform the quality policy quiz
quiz_employees<- read.csv("Employees.csv", colClasses = "character")
excluded_emp<- c("Ahmed Hanafy","Islam Yahia","Ahmed Nagy","Ahmed Abo Ahmed","Ibrahim Reda","Ibrahim Essam","Ahmad Yassin","Osama Gamal El-Din")
quiz_employees<- subset (quiz_employees,! quiz_employees$Name %in% excluded_emp )
quiz_employees$Email.ID<-tolower(quiz_employees$Email.ID)
responses<- read.csv("Quality Policy Quiz (Responses) - Form Responses 1.csv", colClasses = "character")
not_done<- data.frame(
Late_Employee_Name=character(),
Team=character(),
Mail=character(),
Joining_date=character(),
stringsAsFactors=FALSE)
for(i in 1: nrow(quiz_employees))
{
if (quiz_employees[i,]$Email.ID %in% responses$Email.Address)
{
next
}
not_done[i,]$Late_Employee_Name<-(quiz_employees[i,]$Name)
not_done[i,]$ Team<-(quiz_employees[i,]$Department)
not_done[i,]$ Mail <-(quiz_employees[i,]$Email.ID )
not_done[i,]$ Joining_date <-(quiz_employees[i,]$JoiningDate )
}
not_done <- not_done[!apply(is.na( not_done) | not_done == "", 1, all),]
not_done$ Late_Employee_Name <-sapply( not_done$ Late_Employee_Name, as.character)
not_done$ Late_Employee_Name[is.na( not_done$ Late_Employee_Name)] <- " "
not_done$Team<- sapply( not_done$Team, as.character)
not_done$Team[is.na( not_done$Team)] <- " "
not_done$Joining_date<- as.Date(not_done$Joining_date,format="%d-%b-%y")
must_before<- today() - ddays(3)
late_quiz_employees<-subset(not_done,!not_done$Joining_date>must_before)
write.csv(late_quiz_employees, file = "quiz_late_employeesTTT.csv",row.names=FALSE)
This is the second version of the script in this version:
This Script is used for sending e-mails to employees who are late for EPM sheet submition and copying their M+1 and M+2 (except for whose M+2 is the CEO) and the quality director.
mails<- read.csv("late_employees-2020.csv", colClasses = "character")
for(i in 1:nrow(mails)){if(mails[i,]$Mail.M.2=="mohamed.mohsen@si-vision.com"){mails[i,]$Mail.M.2<-""}}
for (i in 1:nrow(mails))
{
library("gmailr")
my_email_message<-gm_mime() %>%
gm_to(mails[i,"Email.ID"]) %>%
gm_cc(c("sherif.saif@si-vision.com",mails[i,"Mail.M.1"],mails[i,"Mail.M.2"])) %>%
gm_from("quality.communication.no-reply@si-vision.com") %>%
gm_subject(paste("[EPM audit]",mails[i,"Name"],": 1 late timesheet")) %>%
gm_text_body(paste("Dear,", mails[i,"Name"],
"\n\nAs a result of the weekly EPM audit, it was found that you have a late timesheet report for the week of "The_Late_EPM_Sheet_Date". This week is delayed by "Number of late weeks".
Please fill and submit the late sheet as soon as you could.
Please do not reply to this message it is an automatic message.
Thank You,
Quality Team"))
gm_send_message(my_email_message)}
This Script is used for sending e-mails to employees who are late for EPM sheet submition for more than one week and copying their M+1 and M+2 (except for whose M+2 is the CEO) and the quality director.
for(i in 1:nrow(mails)){if(mails[i,]$Mail.M.2=="mohamed.mohsen@si-vision.com"){mails[i,]$Mail.M.2<-""}}
for (i in 1: nrow(mails)) #nrow(mails)
{library("gmailr")
my_email_message<-gm_mime() %>%
gm_to(mails[i,"Email.ID"]) %>%
gm_cc(c("sherif.saif@si-vision.com",mails[i,"Mail.M.1"],mails[i,"Mail.M.2"])) %>%
gm_from("quality.communication.no-reply@si-vision.com") %>%
gm_subject(paste("[EPM audit]",mails[i,"Name"],": Severe late, 1 late time sheet")) %>%
gm_text_body(paste("Dear,", mails[i,"Name"],
"\n\nAs a result of the weekly EPM audit, it was found that you have a severe late timesheet report for the week of 13-Sep-2020. This week is delayed by one week.
Please fill and submit the late sheet now as we already beyond the deadline.
Please do not reply to this message it is an automatic message
Thank You,
Quality Team"))
This Script is used for sending e-mails to employees who are late for EPM sheets submition for the quarterly forcast and copying their M+1 and M+2 (except for whose M+2 is the CEO) and the quality director.
mails<- read.csv("late_employees-2020.csv", colClasses = "character")
for(i in 1:nrow(mails)){if(mails[i,]$Mail.M.2=="mohamed.mohsen@si-vision.com"){mails[i,]$Mail.M.2<-""}}
for (i in 1:nrow(mails))
{library("gmailr")
my_email_message<-gm_mime() %>%
gm_to(mails[i,"Email.ID"]) %>%
gm_cc(c("sherif.saif@si-vision.com",mails[i,"Mail.M.1"],mails[i,"Mail.M.2"])) %>%
gm_from("quality.communication.no-reply@si-vision.com") %>%
gm_subject(paste("[EPM audit]",mails[i,"Name"],": EPM Quarterly Forecast -severe delay-")) %>%
gm_text_body(paste("Dear,", mails[i,"Name"],
"\n\nAs a result of the EPM Quarterly Forecast audit, it was found that you have a late timesheet report for the week of 26-July-2020.
Please fill and submit ASAP. As you are beyond the deadline. that is a sever delay.
Please do not reply to this message it is an automatic message
Thank You,
Quality Team"))
gm_send_message(my_email_message)}
This Script is used for sending e-mails to employees who are late for quality policy quiz and it is running every month and making sure all emoloyees have done the quiz if the employee joining date is at least 3 days before the quality quiz audit copying the quality director.
mails<- read.csv("quiz_late_employeesTTT.csv", colClasses = "character")
for (i in 1:nrow(mails) ) #nrow(mails)
{library("gmailr")
my_email_message<-gm_mime() %>%
gm_to(mails[i,"Mail"]) %>%
gm_cc(c("sherif.saif@si-vision.com")) %>%
gm_from("quality.communication.no-reply@si-vision.com") %>%
gm_subject(paste("[Quality Quiz Audit]",mails[i,"Late_Employee_Name"],": Late Quality Quiz Submission")) %>%
gm_text_body(paste("Dear,", mails[i,"Late_Employee_Name"],
"\n\n As part of our QMS, all employees shall pass the quality policy quiz. You can find the quality policy and a link to the quiz at the following path in our intranet:
http://intranet.eg.si-vision.com/2019/10/09/quality-policy/
Please, solve the quiz ASAP as another audit will be done.
Please fill and submit the Late quality quiz submission as soon as you could.
Please do not reply to this message it is an automatic message
Thank You,
Quality Team"))
gm_send_message(my_email_message)}
This script is used for generating some analysis on the weekly EPM audit like:
late_employees_data <- read.csv("late_employees-2020.csv", colClasses = "character")
Audit_Metrics <- data.frame(
Team=character(),
Late_sheets_across_all_dates=character(),
Late_employees_across_all_dates=character(),
Date=character(),
Total_Number_of_late_sheets=character(),
Individual=character(),
StaffandAbove=character(),
Senior=character(),
stringsAsFactors=FALSE)
count<-0
count_date<-0
count_Individual<-0
count_StaffandAbove<-0
count_Senior<-0
count_name<-0
for ( i in 1:nrow(late_employees_data))
{
for(j in 1:nrow(late_employees_data) )
{
if (late_employees_data [i,]$ Department==late_employees_data [j,]$ Department)
{
count=count+1
}
}
Audit_Metrics [i,]$ Team<- late_employees_data[i,]$ Department
Audit_Metrics [i,]$Late_sheets_across_all_dates<-count
count=0
}
Audit_Metrics<-unique(Audit_Metrics)
for ( i in 1:nrow(late_employees_data))
{
for(j in 1:nrow(late_employees_data) )
{
if (late_employees_data [i,]$ Start_of_the_late_week==late_employees_data [j,]$ Start_of_the_late_week)
{
count_date=count_date+1
if (late_employees_data [j,]$title=="Staff&Above")
{
count_StaffandAbove=count_StaffandAbove+1
}
else if (late_employees_data [j,]$title=="Senior")
{
count_Senior=count_Senior+1
}
else
{
count_Individual=count_Individual+1
}
}
}
Audit_Metrics [i,]$Date<-late_employees_data[i,]$ Start_of_the_late_week
Audit_Metrics [i,]$Total_Number_of_late_sheets<-count_date
Audit_Metrics [i,]$Individual<-count_Individual
Audit_Metrics [i,]$StaffandAbove<-count_StaffandAbove
Audit_Metrics [i,]$Senior<-count_Senior
count_Individual=0
count_StaffandAbove=0
count_Senior=0
count_date=0
}
Audit_Metrics<-unique(Audit_Metrics)
# #####################
Audit_Metrics $Team<- sapply(Audit_Metrics $Team, as.character)
Audit_Metrics $Team[is.na(Audit_Metrics $Team)] <- " "
Audit_Metrics $ Late_sheets_across_all_dates <-sapply(Audit_Metrics $ Late_sheets_across_all_dates , as.character)
Audit_Metrics $ Late_sheets_across_all_dates[is.na(Audit_Metrics $ Late_sheets_across_all_dates)] <- " "
Audit_Metrics $ Late_employees_across_all_dates <-sapply(Audit_Metrics $ Late_employees_across_all_dates , as.character)
Audit_Metrics $ Late_employees_across_all_dates[is.na(Audit_Metrics $ Late_employees_across_all_dates)] <- " "
Audit_Metrics $Date<- sapply(Audit_Metrics $ Date, as.character)
Audit_Metrics $Date[is.na(Audit_Metrics $ Date)] <- " "
Audit_Metrics $Total_Number_of_late_sheets<- sapply(Audit_Metrics $ Total_Number_of_late_sheets, as.character)
Audit_Metrics $Total_Number_of_late_sheets[is.na(Audit_Metrics $ Total_Number_of_late_sheets)] <- " "
Audit_Metrics $Individual<- sapply(Audit_Metrics $Individual, as.character)
Audit_Metrics $Individual[is.na(Audit_Metrics $Individual)] <- " "
Audit_Metrics $ StaffandAbove<- sapply(Audit_Metrics $ StaffandAbove, as.character)
Audit_Metrics $ StaffandAbove[is.na(Audit_Metrics $ StaffandAbove)] <- " "
Audit_Metrics $ Senior<- sapply(Audit_Metrics $ Senior, as.character)
Audit_Metrics $ Senior[is.na(Audit_Metrics $ Senior)] <- " "
##############
duplicate_indexes <- which(duplicated(late_employees_data[c('Name', 'Department')]),)
if (length(duplicate_indexes) != 0)
{late_employees_data<- late_employees_data[-duplicate_indexes,]}
for ( i in 1:nrow(Audit_Metrics))
{
if( Audit_Metrics [i,]$Late_sheets_across_all_dates == 1)
{
Audit_Metrics [i,]$Late_employees_across_all_dates = 1
}
else
{
for(j in 1:nrow(late_employees_data) )
{
if (Audit_Metrics [i,]$ Team ==late_employees_data [j,]$ Department)
{
count=count+1
}
}
Audit_Metrics [i,]$Late_employees_across_all_dates<-count
count=0
}
}
write.csv(Audit_Metrics , file = "audit-metrics.csv",row.names=FALSE)
This is the second version of the script in this version:
This script is used for generating analysis on the last four EPM audits to know the following:
First_week<- read.csv("Firstweek.csv", colClasses = "character")
Second_week <- read.csv("Secondweek.csv", colClasses = "character")
Third_week <- read.csv("Thirdweek.csv", colClasses = "character")
Fourth_week <- read.csv("Fourthweek.csv", colClasses = "character")
First_week<- subset(First_week, select = -c(1,4,5))
Second_week<- subset(Second_week, select = -c(1,5))
Third_week<- subset(Third_week, select = -c(1,5))
Fourth_week<- subset(Fourth_week, select = -c(1,5))
###
mergeed <- rbind(First_week,Second_week,Third_week,Fourth_week)
mergeed<- subset(mergeed, select = -c(2,4:6))
###
count_1<-as.data.frame(table(mergeed$Name))
colnames(count_1)[1] <- "Name_of_Employee"
sum_count_1<- sum(count_1$Freq)
#####
count_2<-as.data.frame(table(mergeed$Reporting.To))
colnames(count_2)[1] <- "Name_of_Reporting.To"
count_2$Firstweek=""
count_2$Secondweek=""
count_2$Thirdweek=""
count_2$Fourthweek=""
count_first<-0
count_second<-0
count_third<-0
count_fourth<-0
for(i in 1:nrow(count_2))
{for(j in 1:nrow(First_week))
{
if(count_2[i,]$Name_of_Reporting.To==First_week[j,]$Reporting.To)
{
count_first<-count_first+1
}
}
count_2[i,]$Firstweek<- count_first
count_first<-0
}
for(i in 1:nrow(count_2))
{for(j in 1:nrow(Second_week))
{
if(count_2[i,]$Name_of_Reporting.To==Second_week[j,]$Reporting.To)
{
count_second<-count_second+1
}
}
count_2[i,]$Secondweek<- count_second
count_second<-0
}
for(i in 1:nrow(count_2))
{for(j in 1:nrow(Third_week))
{
if(count_2[i,]$Name_of_Reporting.To==Third_week[j,]$Reporting.To)
{
count_third<-count_third+1
}
}
count_2[i,]$Thirdweek<- count_third
count_third<-0
}
for(i in 1:nrow(count_2))
{for(j in 1:nrow(Fourth_week))
{
if(count_2[i,]$Name_of_Reporting.To==Fourth_week[j,]$Reporting.To)
{
count_fourth<-count_fourth+1
}
}
count_2[i,]$Fourthweek<- count_fourth
count_fourth<-0
}
sum_count_2<- sum(count_2$Freq)
#####
write.csv(count_1, file = "query_names.csv",row.names=FALSE)
write.csv(count_2, file = "query_reportingto.csv",row.names=FALSE)
This script is used for excluding employees that are in the Si-Vision employees list and don’t appear in EPM reports that generated from synopsys. Except for some known cases and generate an csv file called “Si-Vision-Employees-Not-In-EPM-Report.csv”
outcome_file <- read.csv("Manager_QRT_NA_report_V4bk.csv", colClasses = "character")
outcome_file_1 <- read.csv("Manager_QRT_NA_report_V4bk_1.csv", colClasses = "character")
outcome_file_2 <- read.csv("Manager_QRT_NA_report_V4bk_2.csv", colClasses = "character")
# contains the names of employees in si-vision after edit (that is handled in another R.file)
sivi_Employees<- read.csv("Employees.csv", colClasses = "character")
# get the names from synopsys report
SNPS_NAMES<-(outcome_file $ResourceName1)
SNPS_NAMES_1<-(outcome_file_1 $ResourceName1)
SNPS_NAMES_2<-(outcome_file_2 $ResourceName1)
all<- c(SNPS_NAMES, SNPS_NAMES_1,SNPS_NAMES_2)
setDiff<-setdiff(sivi_Employees$Name, all)
Diff_Names<- subset(sivi_Employees,sivi_Employees$Name %in% intersect(setDiff,sivi_Employees$Name))
already_known <- c("Ahmed Hanafy")
Diff_Names<- subset(Diff_Names,! Diff_Names$Name %in% already_known )
Diff_Names$JoiningDate<- as.Date(Diff_Names$JoiningDate,format="%d-%b-%y")
Diff_Names<- subset(Diff_Names, Diff_Names$JoiningDate < today())
write.csv(Diff_Names, file = "Si-Vision-Employees-Not-In-EPM-Report.csv",row.names=FALSE)
This script is used for generating list of late employees that didn’t submit their EPM time sheets through the following steps:
# Read reports generated from SNPS
outcome_file <- read.csv("Manager_QRT_NA_report_V4bk.csv", colClasses = "character")
outcome_file_1 <- read.csv("Manager_QRT_NA_report_V4bk_1.csv", colClasses = "character")
outcome_file_2 <- read.csv("Manager_QRT_NA_report_V4bk_2.csv", colClasses = "character")
outcome_file$StartDate<- as.Date(outcome_file$StartDate,format="%m/%d/%y")
outcome_file_1$StartDate<- as.Date(outcome_file_1$StartDate,format="%m/%d/%y")
outcome_file_2$StartDate<- as.Date(outcome_file_2$StartDate,format="%m/%d/%y")
Anatoly <- c("Abdel-Rahman El-Maghraby","Ahmed Hassan","Mohamed Abdelaziz","Nour Ali","Yasmine Ismail")
Boris <- c("Mohannad Asar","Hoda Thabet","Nadine Hesham","Ahmed Fouda","Mariam Gamal","Esraa Abdellatif"
,"Mohamed Mansour","Yousef Mostafa","Ahmed Gamal (agamal)")
# Read the list of Si-Vision employees
sivi_Employees<- read.csv("Employees.csv", colClasses = "character")
Dates <- c("8/2/2020","8/9/2020","8/16/2020","8/23/2020", "8/30/2020","9/6/2020","9/13/2020",
"9/20/2020","9/27/2020","10/4/2020","10/11/2020","10/18/2020","10/25/2020")
Dates <- as.Date( Dates ,format="%m/%d/%y")
sdate <- today()
Dates_to_check <- subset(Dates,Dates < sdate)
for ( i in seq_along( Dates_to_check) )
{
# Extract only late employees from cairo site
cairo_site<- subset(outcome_file,Manager2 == " " & TimesheetStatus %in% c("In Progress","Not yet Created") & StartDate == Dates_to_check[i] )
cairo_site_1<- subset(outcome_file_1, ResourceName1 %in% Anatoly & TimesheetStatus %in% c("In Progress","Not yet Created") & StartDate == Dates_to_check[i] )
cairo_site_2<- subset(outcome_file_2, ResourceName1 %in% Boris & TimesheetStatus %in% c("In Progress","Not yet Created") & StartDate == Dates_to_check[i] )
compare<- cairo_site$ResourceName1
compare_1<- cairo_site_1$ResourceName1
compare_2<- cairo_site_2$ResourceName1
# final late emploeees
late_employees<-intersect(cairo_site$ResourceName1,sivi_Employees$Name)
late_employees_1<-intersect(cairo_site_1$ResourceName1,sivi_Employees$Name)
late_employees_2<-intersect(cairo_site_2$ResourceName1,sivi_Employees$Name)
#
#setdiff(x,y) are those elements in x but not in y.
#check if there is a name didn't recognized (shall be character (0))
setDiff<-setdiff(compare,late_employees)
setDiff_1<-setdiff(compare_1,late_employees_1)
setDiff_2<-setdiff(compare_2,late_employees_2)
if(!identical(setDiff, character(0)) )
{ print("there is a name/names didn't recognized in the main one") }
if(!identical(setDiff_1, character(0)) )
{ print("there is a name/names didn't recognized in the _1 anatoly") }
if(!identical(setDiff_2, character(0)) )
{ print("there is a name/names didn't recognized in the _2 bouris") }
##### In case of all late employees are addressed #####
# Arrange the late employees
#final<- subset(sivi_Employees,(sivi_Employees$Name %in% late_employees | sivi_Employees$Name %in% late_employees_1 | sivi_Employees$Name %in% late_employees_2) & !sivi_Employees$Name %in% managers )
final<- subset(sivi_Employees,(sivi_Employees$Name %in% late_employees | sivi_Employees$Name %in% late_employees_1 | sivi_Employees$Name %in% late_employees_2))
final<- final[order(final$Reporting.To),]
if (nrow(final) !=0 )
{
final$Starte_of_Date_Late = numeric(nrow(final))
final$Starte_of_Date_Late<-as.Date(final$Starte_of_Date_Late, origin = "1970-01-01")
for(j in 1:nrow(final)){final[j,]$Starte_of_Date_Late<-Dates_to_check[i]}
}
## write output and append the existing file
write.table(final, "late_employees-2020.csv", sep = ",",row.names=FALSE, col.names = !file.exists("late_employees-2020.csv"), append = T)
read_employees<-read.csv("late_employees-2020.csv", colClasses = "character")
read_employees<-unique(read_employees)
write.csv(read_employees, file = "late_employees-2020.csv",row.names=FALSE)
}
This is the second version of the script in this version:
The quality team will work on the following items ISA: