library(ggplot2)
library(akima)
library(dplyr)
## 
## Attaching package: 'dplyr'
## 
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## 
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
library(reshape2)
library(car)
library(ade4)
library(adegraphics)
## 
## Attaching package: 'adegraphics'
## 
## The following objects are masked from 'package:ade4':
## 
##     kplotsepan.coa, s.arrow, s.class, s.corcircle, s.distri,
##     s.image, s.label, s.logo, s.match, s.traject, s.value,
##     table.value, triangle.class
afsp <- read.csv("~/afsp.csv")

afsp$wave <- as.factor(afsp$wave)
afsp$gndr <- as.factor(afsp$gndr)
afsp$i9r <- as.factor(afsp$i9r)

levels(afsp$gndr)[levels(afsp$gndr)=="1"] <- "Homme"
levels(afsp$gndr)[levels(afsp$gndr)=="2"] <- "Femme"

levels(afsp$i9r)[levels(afsp$i9r)=="0"] <- "Gauche"
levels(afsp$i9r)[levels(afsp$i9r)=="10"] <- "Droite"

afsp2 <- na.omit(afsp)
afsp2 <- filter(afsp2, wave=="1" | wave=="2" | wave=="4" | wave=="6" | wave=="7")


tab1 <- table(afsp2$i9r, afsp2$wave)
tab1.1 <- prop.table(tab1)
tab1.2 <- t(tab1.1)
tab1.3 <- prop.table(tab1,1)
tab2 <- addmargins(prop.table(tab1, 2),1)

tab2
##         
##                   1          2 3          4 5          6          7
##   Gauche 0.00000000 0.00000000   0.01602564   0.03535354 0.06199021
##   1      0.04279601 0.04746318   0.03685897   0.03198653 0.02773246
##   2      0.03566334 0.03764321   0.07371795   0.08922559 0.07177814
##   3      0.12553495 0.11620295   0.11057692   0.09427609 0.11256117
##   4      0.11982882 0.11456628   0.12820513   0.08922559 0.09787928
##   5      0.10556348 0.09492635   0.23557692   0.22727273 0.23001631
##   6      0.24821683 0.26022913   0.09935897   0.10606061 0.10603589
##   7      0.10413695 0.10965630   0.12660256   0.12794613 0.11092985
##   8      0.10841655 0.11620295   0.12339744   0.12794613 0.10277325
##   9      0.08844508 0.08346972   0.02884615   0.03030303 0.03262643
##   Droite 0.02139800 0.01963993   0.02083333   0.04040404 0.04567700
##   Sum    1.00000000 1.00000000   1.00000000   1.00000000 1.00000000
dft2 <- as.data.frame.table(tab2)

d1 = as.data.frame(prop.table(table(afsp2$wave, afsp2$i9r),1)*100) 
gg1 <- ggplot(d1, aes(x=Var1,y=Freq, fill=Var2))
gg1 + geom_bar(stat="identity")  + xlab("vague d'enquête") + ylab("fréquence") + ggtitle("Evolution de l'autopositionnement")
## Warning: Removed 22 rows containing missing values (position_stack).

fmg <- lm(pgx ~ gndr + diplo+ religion+ age2 + i9r * wave, afsp2, weights=zpw)

summary(fmg)
## 
## Call:
## lm(formula = pgx ~ gndr + diplo + religion + age2 + i9r * wave, 
##     data = afsp2, weights = zpw)
## 
## Weighted Residuals:
##      Min       1Q   Median       3Q      Max 
## -11.4490  -0.6378  -0.0928   0.5861   9.0730 
## 
## Coefficients: (2 not defined because of singularities)
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       13.117082   1.611514   8.140 5.70e-16 ***
## gndrFemme         -0.079508   0.056943  -1.396 0.162737    
## diploaucun        -2.214889   0.688500  -3.217 0.001309 ** 
## diploBAC          -2.207513   0.687933  -3.209 0.001346 ** 
## diploBEPC         -2.859362   0.686734  -4.164 3.22e-05 ***
## diploCAP / BEP    -2.596845   0.685476  -3.788 0.000155 ***
## diploCEP          -2.250437   0.699013  -3.219 0.001298 ** 
## diploUniv 1       -2.256670   0.687107  -3.284 0.001034 ** 
## diploUniv 2       -2.436291   0.687271  -3.545 0.000399 ***
## religionaucune    -6.309289   1.322337  -4.771 1.92e-06 ***
## religionautre     -6.206430   1.334723  -4.650 3.46e-06 ***
## religionchretiens -6.126780   1.321357  -4.637 3.69e-06 ***
## religionmusulman  -5.225317   1.326852  -3.938 8.39e-05 ***
## age2              -0.018224   0.002158  -8.446  < 2e-16 ***
## i9r1              -0.045940   0.682811  -0.067 0.946363    
## i9r2               0.599696   0.674283   0.889 0.373866    
## i9r3               0.737954   0.636526   1.159 0.246405    
## i9r4              -0.283756   0.637365  -0.445 0.656206    
## i9r5               0.074642   0.643133   0.116 0.907613    
## i9r6              -1.364271   0.621461  -2.195 0.028219 *  
## i9r7              -1.998619   0.636730  -3.139 0.001712 ** 
## i9r8              -2.246275   0.639428  -3.513 0.000450 ***
## i9r9              -2.632260   0.647478  -4.065 4.91e-05 ***
## i9rDroite         -2.840844   0.411117  -6.910 5.86e-12 ***
## wave2             -0.579930   0.646464  -0.897 0.369747    
## wave4             -1.623191   0.723574  -2.243 0.024949 *  
## wave6             -1.179439   0.667248  -1.768 0.077224 .  
## wave7              0.089806   0.578445   0.155 0.876631    
## i9r1:wave2         0.759688   0.770478   0.986 0.324213    
## i9r2:wave2         0.701950   0.758213   0.926 0.354625    
## i9r3:wave2         0.576030   0.698129   0.825 0.409376    
## i9r4:wave2         0.215437   0.692395   0.311 0.755709    
## i9r5:wave2        -0.518905   0.714085  -0.727 0.467483    
## i9r6:wave2        -0.067772   0.665916  -0.102 0.918944    
## i9r7:wave2         0.606470   0.693202   0.875 0.381707    
## i9r8:wave2         0.440438   0.699295   0.630 0.528851    
## i9r9:wave2         0.099208   0.729101   0.136 0.891776    
## i9rDroite:wave2          NA         NA      NA       NA    
## i9r1:wave4         1.715160   0.878592   1.952 0.051009 .  
## i9r2:wave4         1.348064   0.802794   1.679 0.093212 .  
## i9r3:wave4         1.550839   0.765055   2.027 0.042739 *  
## i9r4:wave4         1.443004   0.771570   1.870 0.061548 .  
## i9r5:wave4         0.609220   0.760593   0.801 0.423205    
## i9r6:wave4         1.190298   0.759765   1.567 0.117295    
## i9r7:wave4         1.655087   0.760689   2.176 0.029648 *  
## i9r8:wave4         1.318748   0.766305   1.721 0.085366 .  
## i9r9:wave4         1.497774   0.863861   1.734 0.083051 .  
## i9rDroite:wave4    1.144223   0.732851   1.561 0.118549    
## i9r1:wave6         2.463474   0.858607   2.869 0.004144 ** 
## i9r2:wave6         1.236542   0.747333   1.655 0.098106 .  
## i9r3:wave6         1.270710   0.729980   1.741 0.081828 .  
## i9r4:wave6         0.673754   0.727759   0.926 0.354626    
## i9r5:wave6        -0.051255   0.707143  -0.072 0.942223    
## i9r6:wave6         0.883246   0.699730   1.262 0.206948    
## i9r7:wave6         1.551520   0.718112   2.161 0.030807 *  
## i9r8:wave6         0.803278   0.711653   1.129 0.259092    
## i9r9:wave6         1.210684   0.813587   1.488 0.136832    
## i9rDroite:wave6    0.829675   0.644841   1.287 0.198318    
## i9r1:wave7         0.619958   0.775737   0.799 0.424244    
## i9r2:wave7        -0.195389   0.681432  -0.287 0.774336    
## i9r3:wave7        -0.891252   0.648302  -1.375 0.169309    
## i9r4:wave7         0.030691   0.655334   0.047 0.962650    
## i9r5:wave7        -1.565358   0.621241  -2.520 0.011795 *  
## i9r6:wave7        -0.709118   0.617737  -1.148 0.251087    
## i9r7:wave7        -0.201354   0.626091  -0.322 0.747774    
## i9r8:wave7        -0.451384   0.643096  -0.702 0.482800    
## i9r9:wave7        -0.320287   0.732320  -0.437 0.661882    
## i9rDroite:wave7          NA         NA      NA       NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.522 on 3077 degrees of freedom
## Multiple R-squared:  0.3928, Adjusted R-squared:   0.38 
## F-statistic: 30.63 on 65 and 3077 DF,  p-value: < 2.2e-16
fmd <- lm(pdx ~ gndr + diplo + religion + age2 + i9r * wave, afsp2, weights=zpw)

summary(fmd)
## 
## Call:
## lm(formula = pdx ~ gndr + diplo + religion + age2 + i9r * wave, 
##     data = afsp2, weights = zpw)
## 
## Weighted Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.9256  -0.7413   0.0015   0.7352  12.1063 
## 
## Coefficients: (2 not defined because of singularities)
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)        3.229618   1.726028   1.871 0.061422 .  
## gndrFemme         -0.403269   0.060990  -6.612 4.45e-11 ***
## diploaucun        -1.472068   0.737425  -1.996 0.045997 *  
## diploBAC          -1.524373   0.736817  -2.069 0.038642 *  
## diploBEPC         -1.826946   0.735534  -2.484 0.013050 *  
## diploCAP / BEP    -2.192213   0.734186  -2.986 0.002850 ** 
## diploCEP          -2.021892   0.748685  -2.701 0.006960 ** 
## diploUniv 1       -0.955134   0.735933  -1.298 0.194434    
## diploUniv 2       -1.042325   0.736109  -1.416 0.156879    
## religionaucune    -0.336131   1.416302  -0.237 0.812416    
## religionautre      0.052372   1.429569   0.037 0.970779    
## religionchretiens  0.240730   1.415253   0.170 0.864945    
## religionmusulman  -0.011733   1.421138  -0.008 0.993413    
## age2               0.006420   0.002311   2.778 0.005505 ** 
## i9r1              -1.088877   0.731332  -1.489 0.136617    
## i9r2              -0.261809   0.722197  -0.363 0.716990    
## i9r3              -0.307215   0.681757  -0.451 0.652294    
## i9r4               0.186127   0.682656   0.273 0.785140    
## i9r5               0.909661   0.688834   1.321 0.186739    
## i9r6               0.926599   0.665622   1.392 0.163999    
## i9r7               1.426951   0.681976   2.092 0.036487 *  
## i9r8               1.791982   0.684866   2.617 0.008926 ** 
## i9r9               1.477322   0.693487   2.130 0.033228 *  
## i9rDroite          1.681089   0.440331   3.818 0.000137 ***
## wave2             -0.122206   0.692402  -0.176 0.859916    
## wave4             -1.071138   0.774991  -1.382 0.167032    
## wave6             -0.498297   0.714663  -0.697 0.485701    
## wave7             -0.165927   0.619550  -0.268 0.788857    
## i9r1:wave2         0.290125   0.825228   0.352 0.725185    
## i9r2:wave2         0.163984   0.812092   0.202 0.839986    
## i9r3:wave2         0.455689   0.747738   0.609 0.542289    
## i9r4:wave2         0.118032   0.741597   0.159 0.873553    
## i9r5:wave2        -0.873676   0.764828  -1.142 0.253412    
## i9r6:wave2         0.111329   0.713236   0.156 0.875972    
## i9r7:wave2         0.189678   0.742461   0.255 0.798375    
## i9r8:wave2        -0.220970   0.748987  -0.295 0.767995    
## i9r9:wave2         0.621528   0.780911   0.796 0.426150    
## i9rDroite:wave2          NA         NA      NA       NA    
## i9r1:wave4         1.480499   0.941025   1.573 0.115756    
## i9r2:wave4         1.396585   0.859841   1.624 0.104428    
## i9r3:wave4         1.447465   0.819420   1.766 0.077419 .  
## i9r4:wave4         1.501848   0.826398   1.817 0.069262 .  
## i9r5:wave4         1.482333   0.814640   1.820 0.068915 .  
## i9r6:wave4         2.829346   0.813754   3.477 0.000514 ***
## i9r7:wave4         1.830346   0.814744   2.247 0.024741 *  
## i9r8:wave4         1.595673   0.820759   1.944 0.051969 .  
## i9r9:wave4         1.030133   0.925248   1.113 0.265641    
## i9rDroite:wave4   -0.064574   0.784928  -0.082 0.934439    
## i9r1:wave6         0.945910   0.919620   1.029 0.303755    
## i9r2:wave6         1.019861   0.800439   1.274 0.202715    
## i9r3:wave6         1.088105   0.781852   1.392 0.164114    
## i9r4:wave6         1.433357   0.779474   1.839 0.066029 .  
## i9r5:wave6         1.176746   0.757392   1.554 0.120363    
## i9r6:wave6         1.481761   0.749452   1.977 0.048117 *  
## i9r7:wave6         1.684686   0.769141   2.190 0.028574 *  
## i9r8:wave6         1.052980   0.762224   1.381 0.167239    
## i9r9:wave6         2.195915   0.871401   2.520 0.011786 *  
## i9rDroite:wave6   -0.497850   0.690663  -0.721 0.471070    
## i9r1:wave7         0.566886   0.830861   0.682 0.495109    
## i9r2:wave7         0.589948   0.729855   0.808 0.418976    
## i9r3:wave7         0.871696   0.694370   1.255 0.209438    
## i9r4:wave7         0.975766   0.701902   1.390 0.164577    
## i9r5:wave7         0.440600   0.665387   0.662 0.507911    
## i9r6:wave7         2.200933   0.661634   3.327 0.000890 ***
## i9r7:wave7         1.558613   0.670581   2.324 0.020176 *  
## i9r8:wave7         0.765796   0.688794   1.112 0.266315    
## i9r9:wave7         0.727346   0.784359   0.927 0.353837    
## i9rDroite:wave7          NA         NA      NA       NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.631 on 3077 degrees of freedom
## Multiple R-squared:  0.3517, Adjusted R-squared:  0.338 
## F-statistic: 25.68 on 65 and 3077 DF,  p-value: < 2.2e-16
fmfn <- lm(fn ~ gndr + diplo + religion + age2 + i9r * wave, afsp2, weights=zpw)

summary(fmfn)
## 
## Call:
## lm(formula = fn ~ gndr + diplo + religion + age2 + i9r * wave, 
##     data = afsp2, weights = zpw)
## 
## Weighted Residuals:
##      Min       1Q   Median       3Q      Max 
## -15.0000  -1.2244  -0.1278   0.8175  21.0372 
## 
## Coefficients: (2 not defined because of singularities)
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       -0.483934   2.928690  -0.165  0.86877    
## gndrFemme         -0.030008   0.103486  -0.290  0.77186    
## diploaucun        -1.791785   1.251247  -1.432  0.15225    
## diploBAC          -3.142487   1.250217  -2.514  0.01200 *  
## diploBEPC         -2.957773   1.248039  -2.370  0.01785 *  
## diploCAP / BEP    -1.806102   1.245753  -1.450  0.14721    
## diploCEP          -3.034511   1.270354  -2.389  0.01697 *  
## diploUniv 1       -3.428938   1.248716  -2.746  0.00607 ** 
## diploUniv 2       -3.943438   1.249014  -3.157  0.00161 ** 
## religionaucune     3.478450   2.403153   1.447  0.14787    
## religionautre      2.310874   2.425664   0.953  0.34083    
## religionchretiens  3.148468   2.401372   1.311  0.18992    
## religionmusulman   2.942613   2.411359   1.220  0.22244    
## age2              -0.008650   0.003921  -2.206  0.02748 *  
## i9r1               1.244252   1.240909   1.003  0.31609    
## i9r2               0.809193   1.225410   0.660  0.50908    
## i9r3               1.188667   1.156792   1.028  0.30424    
## i9r4               0.959308   1.158318   0.828  0.40763    
## i9r5               2.707298   1.168800   2.316  0.02061 *  
## i9r6               3.489506   1.129414   3.090  0.00202 ** 
## i9r7               2.909425   1.157164   2.514  0.01198 *  
## i9r8               3.237606   1.162067   2.786  0.00537 ** 
## i9r9               6.846491   1.176696   5.818 6.55e-09 ***
## i9rDroite          6.981672   0.747145   9.344  < 2e-16 ***
## wave2             -1.257119   1.174854  -1.070  0.28469    
## wave4              1.701881   1.314989   1.294  0.19569    
## wave6              0.128909   1.212626   0.106  0.91535    
## wave7              1.293610   1.051240   1.231  0.21858    
## i9r1:wave2         0.943793   1.400231   0.674  0.50034    
## i9r2:wave2         1.477205   1.377941   1.072  0.28379    
## i9r3:wave2         1.336778   1.268746   1.054  0.29214    
## i9r4:wave2         1.299766   1.258327   1.033  0.30172    
## i9r5:wave2         2.407347   1.297745   1.855  0.06369 .  
## i9r6:wave2         0.646359   1.210204   0.534  0.59332    
## i9r7:wave2         0.227305   1.259793   0.180  0.85683    
## i9r8:wave2         1.053451   1.270865   0.829  0.40721    
## i9r9:wave2        -0.285103   1.325033  -0.215  0.82965    
## i9rDroite:wave2          NA         NA      NA       NA    
## i9r1:wave4        -2.650965   1.596712  -1.660  0.09696 .  
## i9r2:wave4        -1.319684   1.458961  -0.905  0.36578    
## i9r3:wave4        -2.280640   1.390375  -1.640  0.10104    
## i9r4:wave4        -0.165036   1.402216  -0.118  0.90632    
## i9r5:wave4        -1.600475   1.382265  -1.158  0.24701    
## i9r6:wave4        -1.180327   1.380761  -0.855  0.39271    
## i9r7:wave4        -0.652358   1.382441  -0.472  0.63704    
## i9r8:wave4        -0.043355   1.392647  -0.031  0.97517    
## i9r9:wave4        -0.305225   1.569941  -0.194  0.84586    
## i9rDroite:wave4   -5.802640   1.331850  -4.357 1.36e-05 ***
## i9r1:wave6        -0.205756   1.560393  -0.132  0.89510    
## i9r2:wave6        -0.236980   1.358168  -0.174  0.86150    
## i9r3:wave6        -0.839653   1.326632  -0.633  0.52683    
## i9r4:wave6         0.486443   1.322595   0.368  0.71305    
## i9r5:wave6         0.757983   1.285128   0.590  0.55536    
## i9r6:wave6        -0.729493   1.271656  -0.574  0.56624    
## i9r7:wave6         1.864205   1.305063   1.428  0.15327    
## i9r8:wave6         0.575135   1.293326   0.445  0.65657    
## i9r9:wave6        -1.350885   1.478576  -0.914  0.36098    
## i9rDroite:wave6    2.346929   1.171904   2.003  0.04530 *  
## i9r1:wave7        -1.931249   1.409789  -1.370  0.17082    
## i9r2:wave7        -1.037266   1.238403  -0.838  0.40233    
## i9r3:wave7        -1.178985   1.178193  -1.001  0.31706    
## i9r4:wave7        -0.235620   1.190973  -0.198  0.84318    
## i9r5:wave7        -1.363885   1.129015  -1.208  0.22713    
## i9r6:wave7        -1.675980   1.122647  -1.493  0.13557    
## i9r7:wave7        -0.304736   1.137828  -0.268  0.78885    
## i9r8:wave7         0.614364   1.168732   0.526  0.59916    
## i9r9:wave7        -4.259625   1.330884  -3.201  0.00139 ** 
## i9rDroite:wave7          NA         NA      NA       NA    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.767 on 3077 degrees of freedom
## Multiple R-squared:  0.2872, Adjusted R-squared:  0.2722 
## F-statistic: 19.08 on 65 and 3077 DF,  p-value: < 2.2e-16
fmx <- lm(pgx ~ fn*pdx* wave, afsp2, weights=zpw)

summary(fmx)
## 
## Call:
## lm(formula = pgx ~ fn * pdx * wave, data = afsp2, weights = zpw)
## 
## Weighted Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.6253 -0.9406 -0.0810  0.8187 12.0437 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   2.9080026  0.1431545  20.314  < 2e-16 ***
## fn           -0.2038448  0.0384589  -5.300 1.24e-07 ***
## pdx           0.0375410  0.0499373   0.752   0.4523    
## wave2        -0.3446162  0.2010421  -1.714   0.0866 .  
## wave4         0.2278505  0.2058959   1.107   0.2685    
## wave6         0.0629909  0.2205794   0.286   0.7752    
## wave7        -0.0056673  0.2127917  -0.027   0.9788    
## fn:pdx        0.0189464  0.0119264   1.589   0.1123    
## fn:wave2     -0.0285682  0.0572331  -0.499   0.6177    
## fn:wave4     -0.0007342  0.0567684  -0.013   0.9897    
## fn:wave6     -0.0758560  0.0576764  -1.315   0.1885    
## fn:wave7      0.0140225  0.0564737   0.248   0.8039    
## pdx:wave2    -0.0411135  0.0687859  -0.598   0.5501    
## pdx:wave4    -0.1179146  0.0678668  -1.737   0.0824 .  
## pdx:wave6    -0.0999753  0.0695119  -1.438   0.1505    
## pdx:wave7    -0.0989410  0.0683039  -1.449   0.1476    
## fn:pdx:wave2  0.0179174  0.0181678   0.986   0.3241    
## fn:pdx:wave4 -0.0033724  0.0159792  -0.211   0.8329    
## fn:pdx:wave6  0.0244206  0.0170622   1.431   0.1525    
## fn:pdx:wave7 -0.0034356  0.0157293  -0.218   0.8271    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.865 on 3123 degrees of freedom
## Multiple R-squared:  0.07504,    Adjusted R-squared:  0.06941 
## F-statistic: 13.33 on 19 and 3123 DF,  p-value: < 2.2e-16
ak2 <- read.csv("~/ak2.csv")
ak2 <- na.omit(ak2)

aki.2 <- interp(ak2$pgx, ak2$pdx, ak2$fn,
xo=seq(min(ak2$pgx), max(ak2$pgx), length = 20),
yo=seq(min(ak2$pdx), max(ak2$pdx), length = 20), duplicate="median")

filled.contour(x = aki.2$x,
y = aki.2$y,
z = aki.2$z,
color.palette =
colorRampPalette(c("white", "red")),
xlab = "gauche",
ylab = "droite",
main = "Espace politique 2014",
key.title = title(main = "FN", cex.main = 1))

ak21 <- filter(ak2, wave==1)
ak22 <- filter(ak2, wave==2)
ak24 <- filter(ak2, wave==4)
ak26 <- filter(ak2, wave==6)
ak27 <- filter(ak2, wave==7)


akima.li <- interp(ak21$pgx, ak21$pdx, ak21$fn,
xo=seq(min(ak21$pgx), max(ak21$pgx), length = 100),
yo=seq(min(ak21$pdx), max(ak21$pdx), length = 100), duplicate="median")


filled.contour(x = akima.li$x,
y = akima.li$y,
z = akima.li$z,
color.palette =
colorRampPalette(c("white", "black")),
xlab = "gauche",
ylab = "droite",
main = "Espace politique 2014 - vague 1",
key.title = title(main = "FN", cex.main = 1))

akima.li <- interp(ak22$pgx, ak22$pdx, ak22$fn,
xo=seq(min(ak22$pgx), max(ak22$pgx), length = 100),
yo=seq(min(ak22$pdx), max(ak22$pdx), length = 100), duplicate="median")


filled.contour(x = akima.li$x,
y = akima.li$y,
z = akima.li$z,
color.palette =
colorRampPalette(c("white", "black")),
xlab = "gauche",
ylab = "droite",
main = "Espace politique 2014 - vague 2",
key.title = title(main = "FN", cex.main = 1))