-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathl4.R
28 lines (24 loc) · 794 Bytes
/
l4.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
print("Enter number of employees:")
n=as.integer(readline())
EmpID<-as.vector(n)
EmpName<-as.vector(n)
DOJ<-as.vector(n)
EmpCode<-as.vector(n)
Dept<-as.vector(n)
Desig<-as.vector(n)
for(i in 1:n){
print(paste("Enter details of Employee ", i))
EmpID[i]=as.character(readline())
EmpName[i]=as.character(readline())
DOJ[i]=as.character(readline())
EmpCode[i]=as.character(readline())
Dept[i]=as.character(readline())
Desig[i]=as.character(readline())
}
emp <- data.frame(EmpID, EmpName, DOJ, EmpCode, Dept, Desig)
print(emp)
write.csv(emp, file="l4.csv")
read.csv("l4.csv", row.names = 1)
x = data.frame("24", "Jaff", "16/09/28", "emp3", "net", "CRO")
write.table(x, file="l4.csv", append = TRUE, sep = ",", quote = FALSE, col.names = FALSE, row.names = FALSE)
read.csv("l4.csv")