Class 3
Class 3
Class 3
R
apple
2023-09-05
emp <- read.csv("~/Desktop/Cares/RIMS/RDA/emp.csv", stringsAsFactors=TRUE)
head(emp)
names(emp)
summary(emp)
### aggregate
aggregate(salary ~ gender,mean,data=emp)
## gender salary
## 1 Female 28141.98
## 2 Male 50191.25
aggregate(salary ~ Designation,mean,data=emp)
## Designation salary
## 1 ELAM 21633.33
## 2 ELM 30310.00
## 3 MLM 56419.05
## 4 TLM 87335.53
aggregate(salary ~ gender+Designation,mean,data=emp)
aggregate(PRE..EXP ~ gender,median,data=emp)
## gender PRE..EXP
## 1 Female 4
## 2 Male 10
aggregate(PRE..EXP ~ gender+Designation,median,data=emp)
emp_cont = emp[,c(3,6,8:15)]
names(emp_cont)