2 #datadm<-read.table('/home/pierre/.hippasos/corpus_agir.csv',header=TRUE,sep='\t',quote='\"')
3 #data.mjca<-mjca(datadm[,-1],supcol=c(1:12),nd=6)
5 tridata<-function(tabletot,nb=10,fnb=2) {
8 #tabletot<-as.data.frame(sumx[3])
9 tabletotf1<-tabletot[order(tabletot[,5]),]
10 rowkeep1<-tabletotf1[1:nb,]
11 rowkeep1<-rbind(rowkeep1,tabletotf1[(nrow(tabletotf1)-nb):nrow(tabletotf1),])
12 rowf1names<-rownames(rowkeep1)
13 tabletotf2<-tabletot[order(tabletot[,8]),]
14 rowkeep2<-tabletotf2[1:nb,]
15 rowkeep2<-rbind(rowkeep2,tabletotf2[(nrow(tabletotf2)-nb):nrow(tabletotf2),])
16 rowf2names<-rownames(rowkeep2)
18 for (names in 1:length(rowf1names)) {
19 for (names2 in 1:length(rowf2names)) {
20 if (rowf1names[names]==rowf2names[names2]) {
21 rowkeep1<-rowkeep1[-(as.numeric(names)-count),]
26 rowkeep12<-rbind(rowkeep1,rowkeep2)
29 row12names<-rownames(rowkeep12)
30 tabletotf3<-tabletot[order(tabletot[,14]),]
31 rowkeep3<-tabletotf1[1:nb,]
32 rowkeep3<-rbind(rowkeep3,tabletotf3[(nrow(tabletotf3)-nb):nrow(tabletotf3),])
33 rowf3names<-rownames(rowkeep3)
34 for (names in 1:length(row12names)) {
35 for (names3 in 1:length(rowf3names)) {
36 if (rowf3names[names3]==row12names[names]) {
37 rowkeep12<-rowkeep12[-(as.numeric(names)-count),]
42 rowkeep123<-rbind(rowkeep12,rowkeep3)
48 #rowkeep<-tridata(data.mjca,nb=50,fnb=3)
49 #matrow<-as.matrix(rowkeep)
50 #x<-as.numeric(matrow[,5])
51 #y<-as.numeric(matrow[,8])
52 #z<-as.numeric(matrow[,11])
54 #plot3d(x,y,z,xlab='',ylab='',zlab='',box=FALSE,axes=FALSE)
56 #rgl.bg(col = c("#aaaaaa", "#99bb99"), front = "lines", box=FALSE, sphere = TRUE)
57 #rgl.lines(c(range(x)), c(0, 0), c(0, 0), col = "#0000ff")
58 #rgl.lines(c(0,0),c(range(y)),c(0,0),col = "#0000ff")
59 #rgl.lines(c(0,0),c(0,0),c(range(z)),col = "#0000ff")
60 #text3d(range(x)[2]+1,0,0,'f1')
61 #text3d(0,range(y)[2]+1,0,'f2')
62 #text3d(0,0,range(z)[2]+1,'f3')
63 #plot(as.numeric(matrow[,5]),as.numeric(matrow[,8]))
64 #text(as.numeric(matrow[,5]),as.numeric(matrow[,8]),matrow[,1])
66 tridata2<-function(tabletot,nb=5,fnb=2) {
68 #sumx<-summary(atrier)
69 #tabletot<-as.data.frame(sumx[3])
70 tabletotf1<-tabletot[order(tabletot[,1]),]
71 rowkeep1<-tabletotf1[1:nb,]
72 rowkeep1<-rbind(rowkeep1,tabletotf1[(nrow(tabletotf1)-nb):nrow(tabletotf1),])
73 rowf1names<-rownames(rowkeep1)
74 tabletotf2<-tabletot[order(tabletot[,2]),]
75 rowkeep2<-tabletotf2[1:nb,]
76 rowkeep2<-rbind(rowkeep2,tabletotf2[(nrow(tabletotf2)-nb):nrow(tabletotf2),])
77 rowf2names<-rownames(rowkeep2)
79 for (names in 1:length(rowf1names)) {
80 for (names2 in 1:length(rowf2names)) {
81 if (rowf1names[names]==rowf2names[names2]) {
82 rowkeep1<-rowkeep1[-(as.numeric(names)-count),]
87 rowkeep12<-rbind(rowkeep1,rowkeep2)
90 row12names<-rownames(rowkeep12)
91 tabletotf3<-tabletot[order(tabletot[,3]),]
92 rowkeep3<-tabletotf1[1:nb,]
93 rowkeep3<-rbind(rowkeep3,tabletotf3[(nrow(tabletotf3)-nb):nrow(tabletotf3),])
94 rowf3names<-rownames(rowkeep3)
95 for (names in 1:length(row12names)) {
96 for (names3 in 1:length(rowf3names)) {
97 if (rowf3names[names3]==row12names[names]) {
98 rowkeep12<-rowkeep12[-(as.numeric(names)-count),]
103 rowkeep123<-rbind(rowkeep12,rowkeep3)
110 uncover<-function(tabletot,x) {
111 #tabletot=tableau des coordonnées
112 tabletotf1<-tabletot$table[order(tabletot$table[,x]),]
118 if (is.null(tabletot$elim)){
119 elim<-NULL#tabletot#$elim
123 while (i < nrow(tabletotf1)) {
124 signex<-ref[1]*tabletotf1[i,1]
125 signey<-ref[2]*tabletotf1[i,2]
127 dist<-abs(ref)-abs(tabletotf1[i,])
130 if (abs(dist[1])<distminx) {
132 if (abs(dist[2])<distminy) {
133 elim<-rbind(elim,tabletotf1[i,])
134 row.names(elim)[nrow(elim)]<-row.names(tabletotf1)[i]
136 tabletotf1<-tabletotf1[-i,]
141 }else{ref<-tabletotf1[i,];i<-i+1}
153 print(length(tabletotf1))
156 out$table<-tabletotf1
161 #ntb<-tabletot[order(tabletot[,1]),]
163 #ntb2$table<-ntb2$table[order(ntb2$table[,2]),]
164 #ntb2$table<-uncover(ntb2$table)
168 # if (tabletotf1[i,1])
171 # rowkeep1<-tabletotf1[1:nb,]
172 # rowkeep1<-rbind(rowkeep1,tabletotf1[(nrow(tabletotf1)-nb):nrow(tabletotf1),])
173 # rowf1names<-rownames(rowkeep1)
174 # tabletotf2<-tabletot[order(tabletot[,2]),]
175 # rowkeep2<-tabletotf2[1:nb,]
176 # rowkeep2<-rbind(rowkeep2,tabletotf2[(nrow(tabletotf2)-nb):nrow(tabletotf2),])
177 # rowf2names<-rownames(rowkeep2)
179 # for (names in 1:length(rowf1names)) {
180 # for (names2 in 1:length(rowf2names)) {
181 # if (rowf1names[names]==rowf2names[names2]) {
182 # rowkeep1<-rowkeep1[-(as.numeric(names)-count),]
187 # rowkeep12<-rbind(rowkeep1,rowkeep2)
190 # row12names<-rownames(rowkeep12)
191 # tabletotf3<-tabletot[order(tabletot[,3]),]
192 # rowkeep3<-tabletotf1[1:nb,]
193 # rowkeep3<-rbind(rowkeep3,tabletotf3[(nrow(tabletotf3)-nb):nrow(tabletotf3),])
194 # rowf3names<-rownames(rowkeep3)
195 # for (names in 1:length(row12names)) {
196 # for (names3 in 1:length(rowf3names)) {
197 # if (rowf3names[names3]==row12names[names]) {
198 # rowkeep12<-rowkeep12[-(as.numeric(names)-count),]
203 # rowkeep123<-rbind(rowkeep12,rowkeep3)