-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsociety.R
More file actions
43 lines (35 loc) · 1.48 KB
/
society.R
File metadata and controls
43 lines (35 loc) · 1.48 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
pIII <- read.csv('Society Phase-III.csv', header=T, colClasses='character')
old <- read.csv('Phase-I-II.csv',header=T, colClasses='character')
#script begins here
nums <- rep(NA,1000)
indexIII <- rep(NA,1000)
for (i in 1:nrow(pIII))
{
l<- length(grep(paste('.*',pIII$Name[i],'.*'),old$Name..of..Allotters,ignore.case=T))
indexIII<- c(rep(i,l),indexIII)
nums <- c(grep(paste('.*',pIII$Name[i],'.*'),old$Name..of..Allotters,ignore.case=T),nums)
}
write.csv(cbind (pIII[indexIII,],old[nums,]),'dup2israr.csv')
#Run above script upto here or its alternative below
#For functionality of agrep
nums_agrep <- rep(NA,10000)
indexIII_agrep <- rep(NA,10000)
for (i in 1:nrow(pIII))
{
l2<- length(agrep(pIII$Name[i],old[agrep(pIII$Department,old$Inst....Dept.,ignore.case=T),4],ignore.case=T))
indexIII_agrep<- c(rep(i,l2),indexIII_agrep)
nums_agrep <- c(agrep(pIII$Name[i],old[agrep(pIII$Designation,old$Designation,ignore.case=T),4],ignore.case=T),nums_agrep)
}
# this script ends here
#NEW SCRIPT BEGINS
old <- read.csv('Phase-I-II.csv',header=T, colClasses='character')
sc <- read.csv('scrutiny results partial.csv',header=T, colClasses='character')
nums <- rep(NA,10000)
indexIII <- rep(NA,10000)
for (i in 1:nrow(sc))
{
l<- length(grep(paste('.*',sc$Name[i],'.*'),old$Name..of..Allotters,ignore.case=T))
indexIII<- c(rep(i,l),indexIII)
nums <- c(grep(paste('.*',sc$Name[i],'.*'),old$Name..of..Allotters,ignore.case=T),nums)
}
write.csv(cbind (sc[indexIII,],old[nums,]),'dup4mscrutiny.csv')