-
Notifications
You must be signed in to change notification settings - Fork 0
/
Insiemi Fatti Bene Tutti.R
80 lines (70 loc) · 3.23 KB
/
Insiemi Fatti Bene Tutti.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
require(dplyr)
setwd("c:/Users/vince/Desktop/Tesi")
diagnostic.features<- read.csv("Diagnostic_Features.csv")
event.log<-read.csv("Adverse_Event_Log.csv")
patient.status<- read.csv("Patient_Status.csv",fileEncoding = "UTF-8-BOM",sep = ";")
SC<-filter(diagnostic.features,EVENT_ID=="SC")
BL<-filter(diagnostic.features,EVENT_ID=="BL")
V01<-filter(diagnostic.features,EVENT_ID=="V01")
V02<-filter(diagnostic.features,EVENT_ID=="V02")
V03<-filter(diagnostic.features,EVENT_ID=="V03")
V04<-filter(diagnostic.features,EVENT_ID=="V04")
V05<-filter(diagnostic.features,EVENT_ID=="V05")
V06<-filter(diagnostic.features,EVENT_ID=="V06")
V07<-filter(diagnostic.features,EVENT_ID=="V07")
V08<-filter(diagnostic.features,EVENT_ID=="V08")
V09<-filter(diagnostic.features,EVENT_ID=="V09")
V10<-filter(diagnostic.features,EVENT_ID=="V10")
V11<-filter(diagnostic.features,EVENT_ID=="V11")
V12<-filter(diagnostic.features,EVENT_ID=="V12")
V13<-filter(diagnostic.features,EVENT_ID=="V13")
V14<-filter(diagnostic.features,EVENT_ID=="V14")
V15<-filter(diagnostic.features,EVENT_ID=="V15")
ST<-filter(diagnostic.features,EVENT_ID=="ST")
LOG<-filter(event.log,EVENT_ID=="LOG")
dSC<-distinct(SC,PATNO)
dBL<-distinct(BL,PATNO)
dV01<-distinct(V01,PATNO)
dV02<-distinct(V02,PATNO)
dV03<-distinct(V03,PATNO)
dV04<-distinct(V04,PATNO)
dV05<-distinct(V05,PATNO)
dV06<-distinct(V06,PATNO)
dV07<-distinct(V07,PATNO)
dV08<-distinct(V08,PATNO)
dV09<-distinct(V09,PATNO)
dV10<-distinct(V10,PATNO)
dV11<-distinct(V11,PATNO)
dV12<-distinct(V12,PATNO)
dV13<-distinct(V13,PATNO)
dV14<-distinct(V14,PATNO)
dV15<-distinct(V15,PATNO)
dST<-distinct(ST,PATNO)
dLOG<-distinct(LOG,PATNO)
SC.BL<-union(dSC,dBL)
SC.V01<-union(dSC,dBL,dV01)
distUnion<-distinct(SC.BL,PATNO)
distV01<-distinct(union(dSC,dBL,dV01),PATNO)
SC.V02<-union(dSC,dBL,dV01,dV02)
distV02<-distinct(union(dSC,dBL,dV01,dV02),PATNO)
SC.V03<-union(dSC,dBL,dV01,dV02,dV03)
SC.V04<-union(dSC,dBL,dV01,dV02,dV03,dV04)
SC.V05<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05)
SC.V06<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06)
SC.V07<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07)
SC.V08<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08)
SC.V09<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09)
SC.V10<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09,dV10)
SC.V11<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09,dV10,dV11)
SC.V12<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09,dV10,dV11,dV12)
SC.V13<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09,dV10,dV11,dV12,dV13)
SC.V14<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09,dV10,dV11,dV12,dV13,dV14)
SC.V15<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09,dV10,dV11,dV12,dV13,dV14,dV15)
SC.ST<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09,dV10,dV11,dV12,dV13,dV14,dV15,dST)
SC.LOG<-union(dSC,dBL,dV01,dV02,dV03,dV04,dV05,dV06,dV07,dV08,dV09,dV10,dV11,dV12,dV13,dV14,dV15,dST,dLOG)
intersectAll<-intersect(SC.BL,SC.V01,SC.V02,SC.V03,SC.V04,SC.V05
,SC.V06,SC.V07,SC.V08,SC.V09,SC.V10,
SC.V11,SC.V12,SC.V13,SC.V14,SC.V15,
SC.ST,SC.LOG)
out<-patient.status[(patient.status$PATNO %in% SC.BL$PATNO),]
write.csv(out, file = "Patient_Status_SC_BL.csv")