Library loading

library(XLConnect)
## Loading required package: XLConnectJars
## XLConnect 0.2-11 by Mirai Solutions GmbH [aut],
##   Martin Studer [cre],
##   The Apache Software Foundation [ctb, cph] (Apache POI, Apache Commons
##     Codec),
##   Stephen Colebourne [ctb, cph] (Joda-Time Java library)
## http://www.mirai-solutions.com ,
## http://miraisolutions.wordpress.com

Test { Only reading from one Grégoire’s file }

s1 <- readWorksheetFromFile("C:/Users/Antoine/Downloads/Statistiques_REPIN-2015-10-27/Statistiques REPIN/Cousin_3_Lili_010415_Adele.xls", sheet = 1)
s2 <- readWorksheetFromFile("C:/Users/Antoine/Downloads/Statistiques_REPIN-2015-10-27/Statistiques REPIN/Cousin_3_Lili_010415_Adele.xls", sheet = 2)
s3 <- readWorksheetFromFile("C:/Users/Antoine/Downloads/Statistiques_REPIN-2015-10-27/Statistiques REPIN/Cousin_3_Lili_010415_Adele.xls", sheet = 3)
## Warning: Error when trying to evaluate cell B3 - Error evaluating cell
## 'Module 3'!B3
## Warning: Error when trying to evaluate cell B4 - Error evaluating cell
## 'Module 3'!B4
## Warning: Error when trying to evaluate cell C3 - Error evaluating cell
## 'Module 3'!C3
## Warning: Error when trying to evaluate cell C4 - Error evaluating cell
## 'Module 3'!C4
## Warning: Error when trying to evaluate cell D3 - Error evaluating cell
## 'Module 3'!D3
## Warning: Error when trying to evaluate cell D4 - Error evaluating cell
## 'Module 3'!D4
## Warning: Error when trying to evaluate cell E3 - Error evaluating cell
## 'Module 3'!E3
## Warning: Error when trying to evaluate cell E4 - Error evaluating cell
## 'Module 3'!E4
## Warning: Error when trying to evaluate cell F3 - Error evaluating cell
## 'Module 3'!F3
## Warning: Error when trying to evaluate cell F4 - Error evaluating cell
## 'Module 3'!F4
## Warning: Error when trying to evaluate cell G3 - Error evaluating cell
## 'Module 3'!G3
## Warning: Error when trying to evaluate cell G4 - Error evaluating cell
## 'Module 3'!G4
## Warning: Error when trying to evaluate cell H3 - Error evaluating cell
## 'Module 3'!H3
## Warning: Error when trying to evaluate cell H4 - Error evaluating cell
## 'Module 3'!H4
## Warning: Error when trying to evaluate cell I3 - Error evaluating cell
## 'Module 3'!I3
## Warning: Error when trying to evaluate cell I4 - Error evaluating cell
## 'Module 3'!I4
## Warning: Error when trying to evaluate cell J3 - Error evaluating cell
## 'Module 3'!J3
## Warning: Error when trying to evaluate cell J4 - Error evaluating cell
## 'Module 3'!J4
## Warning: Error when trying to evaluate cell K3 - Error evaluating cell
## 'Module 3'!K3
## Warning: Error when trying to evaluate cell K4 - Error evaluating cell
## 'Module 3'!K4
## Warning: Error when trying to evaluate cell L3 - Error evaluating cell
## 'Module 3'!L3
## Warning: Error when trying to evaluate cell L4 - Error evaluating cell
## 'Module 3'!L4
## Warning: Error when trying to evaluate cell M3 - Error evaluating cell
## 'Module 3'!M3
## Warning: Error when trying to evaluate cell M4 - Error evaluating cell
## 'Module 3'!M4
## Warning: Error when trying to evaluate cell N3 - Error evaluating cell
## 'Module 3'!N3
## Warning: Error when trying to evaluate cell N4 - Error evaluating cell
## 'Module 3'!N4
## Warning: Error when trying to evaluate cell O3 - Error evaluating cell
## 'Module 3'!O3
## Warning: Error when trying to evaluate cell O4 - Error evaluating cell
## 'Module 3'!O4
## Warning: Error when trying to evaluate cell P3 - Error evaluating cell
## 'Module 3'!P3
## Warning: Error when trying to evaluate cell P4 - Error evaluating cell
## 'Module 3'!P4
## Warning: Error when trying to evaluate cell Q3 - Error evaluating cell
## 'Module 3'!Q3
## Warning: Error when trying to evaluate cell Q4 - Error evaluating cell
## 'Module 3'!Q4
## Warning: Error when trying to evaluate cell R3 - Error evaluating cell
## 'Module 3'!R3
## Warning: Error when trying to evaluate cell R4 - Error evaluating cell
## 'Module 3'!R4
## Warning: Error when trying to evaluate cell S3 - Error evaluating cell
## 'Module 3'!S3
## Warning: Error when trying to evaluate cell S4 - Error evaluating cell
## 'Module 3'!S4
## Warning: Error when trying to evaluate cell T3 - Error evaluating cell
## 'Module 3'!T3
## Warning: Error when trying to evaluate cell T4 - Error evaluating cell
## 'Module 3'!T4
## Warning: Error when trying to evaluate cell U3 - Error evaluating cell
## 'Module 3'!U3
## Warning: Error when trying to evaluate cell U4 - Error evaluating cell
## 'Module 3'!U4
## Warning: Error when trying to evaluate cell V3 - Error evaluating cell
## 'Module 3'!V3
## Warning: Error when trying to evaluate cell V4 - Error evaluating cell
## 'Module 3'!V4
## Warning: Error when trying to evaluate cell W3 - Error evaluating cell
## 'Module 3'!W3
## Warning: Error when trying to evaluate cell W4 - Error evaluating cell
## 'Module 3'!W4
## Warning: Error when trying to evaluate cell X3 - Error evaluating cell
## 'Module 3'!X3
## Warning: Error when trying to evaluate cell X4 - Error evaluating cell
## 'Module 3'!X4
## Warning: Error when trying to evaluate cell Y3 - Error evaluating cell
## 'Module 3'!Y3
## Warning: Error when trying to evaluate cell Y4 - Error evaluating cell
## 'Module 3'!Y4
## Warning: Error when trying to evaluate cell Z3 - Error evaluating cell
## 'Module 3'!Z3
## Warning: Error when trying to evaluate cell Z4 - Error evaluating cell
## 'Module 3'!Z4
## Warning: Error when trying to evaluate cell AA3 - Error evaluating cell
## 'Module 3'!AA3
## Warning: Error when trying to evaluate cell AA4 - Error evaluating cell
## 'Module 3'!AA4
## Warning: Error when trying to evaluate cell AB3 - Error evaluating cell
## 'Module 3'!AB3
## Warning: Error when trying to evaluate cell AB4 - Error evaluating cell
## 'Module 3'!AB4
## Warning: Error when trying to evaluate cell AC3 - Error evaluating cell
## 'Module 3'!AC3
## Warning: Error when trying to evaluate cell AC4 - Error evaluating cell
## 'Module 3'!AC4
## Warning: Error when trying to evaluate cell AD3 - Error evaluating cell
## 'Module 3'!AD3
## Warning: Error when trying to evaluate cell AD4 - Error evaluating cell
## 'Module 3'!AD4
## Warning: Error when trying to evaluate cell AE3 - Error evaluating cell
## 'Module 3'!AE3
## Warning: Error when trying to evaluate cell AE4 - Error evaluating cell
## 'Module 3'!AE4
s4 <- readWorksheetFromFile("C:/Users/Antoine/Downloads/Statistiques_REPIN-2015-10-27/Statistiques REPIN/Cousin_3_Lili_010415_Adele.xls", sheet = 4)
## Warning: Error when trying to evaluate cell D3 - Error evaluating cell
## 'Module 4'!D3
## Warning: Error when trying to evaluate cell E3 - Error evaluating cell
## 'Module 4'!E3
## Warning: Error when trying to evaluate cell F3 - Error evaluating cell
## 'Module 4'!F3
## Warning: Error when trying to evaluate cell G3 - Error evaluating cell
## 'Module 4'!G3
## Warning: Error when trying to evaluate cell H3 - Error evaluating cell
## 'Module 4'!H3
## Warning: Error when trying to evaluate cell I3 - Error evaluating cell
## 'Module 4'!I3
## Warning: Error when trying to evaluate cell J3 - Error evaluating cell
## 'Module 4'!J3
## Warning: Error when trying to evaluate cell K3 - Error evaluating cell
## 'Module 4'!K3
## Warning: Error when trying to evaluate cell L3 - Error evaluating cell
## 'Module 4'!L3
## Warning: Error when trying to evaluate cell M3 - Error evaluating cell
## 'Module 4'!M3
## Warning: Error when trying to evaluate cell N3 - Error evaluating cell
## 'Module 4'!N3
## Warning: Error when trying to evaluate cell O3 - Error evaluating cell
## 'Module 4'!O3
## Warning: Error when trying to evaluate cell P3 - Error evaluating cell
## 'Module 4'!P3
## Warning: Error when trying to evaluate cell Q3 - Error evaluating cell
## 'Module 4'!Q3
## Warning: Error when trying to evaluate cell R3 - Error evaluating cell
## 'Module 4'!R3
## Warning: Error when trying to evaluate cell S3 - Error evaluating cell
## 'Module 4'!S3
## Warning: Error when trying to evaluate cell T3 - Error evaluating cell
## 'Module 4'!T3
## Warning: Error when trying to evaluate cell U3 - Error evaluating cell
## 'Module 4'!U3
## Warning: Error when trying to evaluate cell V3 - Error evaluating cell
## 'Module 4'!V3
## Warning: Error when trying to evaluate cell W3 - Error evaluating cell
## 'Module 4'!W3
## Warning: Error when trying to evaluate cell X3 - Error evaluating cell
## 'Module 4'!X3
## Warning: Error when trying to evaluate cell Y3 - Error evaluating cell
## 'Module 4'!Y3
## Warning: Error when trying to evaluate cell Z3 - Error evaluating cell
## 'Module 4'!Z3
## Warning: Error when trying to evaluate cell AA3 - Error evaluating cell
## 'Module 4'!AA3
## Warning: Error when trying to evaluate cell AB3 - Error evaluating cell
## 'Module 4'!AB3
## Warning: Error when trying to evaluate cell AC3 - Error evaluating cell
## 'Module 4'!AC3
## Warning: Error when trying to evaluate cell AD3 - Error evaluating cell
## 'Module 4'!AD3
## Warning: Error when trying to evaluate cell AE3 - Error evaluating cell
## 'Module 4'!AE3
## Warning: Error when trying to evaluate cell AF3 - Error evaluating cell
## 'Module 4'!AF3
## Warning: Error when trying to evaluate cell AG3 - Error evaluating cell
## 'Module 4'!AG3
s5 <- readWorksheetFromFile("C:/Users/Antoine/Downloads/Statistiques_REPIN-2015-10-27/Statistiques REPIN/Cousin_3_Lili_010415_Adele.xls", sheet = 5)
head(s1)
##   Code_question
## 1           1_1
## 2           1_2
## 3           1_3
## 4           1_4
## 5           1_5
## 6         1_6_1
##                                                                                                                                                             Questions..variables.
## 1                                                                                                                                                                     Sex / Sexe 
## 2                                                                                                                                                                    Vârsta / Age
## 3                                                                                            În ce localitate v-a<U+021B>i nascut? / Dans quelle ville ou village êtes-vous nés ?
## 4                                                                                                              În ce localitate s-a nascut tatal dumneavoastra? / Et votre père ?
## 5                                                                                                                 În ce localitate s-a nascut mama dumneavoastra? Et votre mère ?
## 6 Care este ceta<U+021B>enia sau sunt ceta<U+021B>enie dumneavoastra (sunte<U+021B>i ceta<U+021B>ean de unde)? / Quelles sont ou quelle est votre nationalité ? Româna / Roumaine
##    Réponses.à.remplir Nature.de.la.réponse
## 1                   2     Chiffre au choix
## 2                  35        Chiffre libre
## 3 Dragasani RM Valcea                Texte
## 4           Rm valcea                Texte
## 5               Sibiu                Texte
## 6                   1     Chiffre au choix
##        Aide..dans.le.questionnaire.papier.
## 1                                     <NA>
## 2                                     <NA>
## 3 (Ora<U+0219> sau sat) (Ville ou village)
## 4 (Ora<U+0219> sau sat) (Ville ou village)
## 5 (Ora<U+0219> sau sat) (Ville ou village)
## 6                       (non = 0, oui = 1)
head(s2)
##   Numéro.de.la.Personne. Nom.de.la.personne...à.remplir
## 1                      1                        Colette
## 2                      2                         Thomas
## 3                      3                            Dan
## 4                      4                         Marine
## 5                      5                        Richard
## 6                      6                         Claude
##   ID_interviewé..automatique.depuis.la.question.5.3.dans.le.module.5.
## 1                                                Cousin_3_Lili_010415
## 2                                                Cousin_3_Lili_010415
## 3                                                Cousin_3_Lili_010415
## 4                                                Cousin_3_Lili_010415
## 5                                                Cousin_3_Lili_010415
## 6                                                Cousin_3_Lili_010415
##   ID_Personne..Automatique.
## 1    Cousin_3_Lili_010415_1
## 2    Cousin_3_Lili_010415_2
## 3    Cousin_3_Lili_010415_3
## 4    Cousin_3_Lili_010415_4
## 5    Cousin_3_Lili_010415_5
## 6    Cousin_3_Lili_010415_6
head(s3)
##   Code_question friend1 friend2 friend3 friend4 friend5 friend6 friend7
## 1           3_0       1       2       3       4       5       6       7
## 2           3_1    <NA>    <NA>    <NA>    <NA>    <NA>    <NA>    <NA>
## 3           3_2    <NA>    <NA>    <NA>    <NA>    <NA>    <NA>    <NA>
## 4           3_3       2       1       1       2       1       1       1
## 5           3_4       6       5       1       5       5       6       5
## 6         3_5_1       1       1       0       1       1       1       1
##   friend8 friend9 friend10 friend11 friend12 friend13 friend14 friend15
## 1       8       9       10       11       12       13       14       15
## 2    <NA>    <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>
## 3    <NA>    <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>
## 4       2       1        2        2        2        2        2        2
## 5       5       5        2        2        2        2        5        5
## 6       1       1        0        0        0        0        1        1
##   friend16 friend17 friend18 friend19 friend20 friend21 friend22 friend23
## 1       16       17       18       19       20       21       22       23
## 2     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>
## 3     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>
## 4        1        1        1        1        2        1        2        1
## 5        5        5        5        6        6        1        1        1
## 6        1        1        1        1        1        0        0        0
##   friend24 friend25 friend26 friend27 friend28 friend29 friend30
## 1       24       25       26       27       28       29       30
## 2     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>
## 3     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>     <NA>
## 4        2        2        2        2        1        1        1
## 5        4        4        2        6        5        6        6
## 6        0        0        0        1        1        1        1
head(s4)
##   N.B..Les.champs.rouges.sont.à.remplir.avec.les.chiffres.1..2.ou.3
## 1                                                              <NA>
## 2                                                ID de la Personne 
## 3                                            Cousin_3_Lili_010415_1
## 4                                            Cousin_3_Lili_010415_2
## 5                                            Cousin_3_Lili_010415_3
## 6                                            Cousin_3_Lili_010415_4
##                    Col2    ID.de.la.personne. Col4 Col5 Col6 Col7 Col8
## 1                  <NA> Numéro de la personne    1    2    3    4    5
## 2 Numéro de la personne                   NOM   NA   NA   NA   NA   NA
## 3                     1               Colette   NA    2    2    2    1
## 4                     2                Thomas   NA   NA    2    2    2
## 5                     3                   Dan   NA   NA   NA    2    2
## 6                     4                Marine   NA   NA   NA   NA    2
##   Col9 Col10 Col11 Col12 Col13 Col14 Col15 Col16 Col17 Col18 Col19 Col20
## 1    6     7     8     9    10    11    12    13    14    15    16    17
## 2   NA    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA
## 3    1     2     1     1     2     2     2     2     2     1     1     1
## 4    2     2     2     2     2     2     2     2     1     1     1     1
## 5    2     2     2     2     2     2     2     2     2     2     2     1
## 6    2     2     2     1     2     2     2     2     1     1     1     1
##   Col21 Col22 Col23 Col24 Col25 Col26 Col27 Col28 Col29 Col30 Col31 Col32
## 1    18    19    20    21    22    23    24    25    26    27    28    29
## 2    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA
## 3     1     1     1     1     1     1     1     1     1     1     1     1
## 4     1     2     1     1     1     1     1     1     1     1     1     1
## 5     1     2     2     2     2     2     2     2     2     2     2     2
## 6     1     2     2     1     1     1     1     1     1     1     1     1
##   Col33
## 1    30
## 2    NA
## 3     1
## 4     1
## 5     2
## 6     1
head(s4)
##   N.B..Les.champs.rouges.sont.à.remplir.avec.les.chiffres.1..2.ou.3
## 1                                                              <NA>
## 2                                                ID de la Personne 
## 3                                            Cousin_3_Lili_010415_1
## 4                                            Cousin_3_Lili_010415_2
## 5                                            Cousin_3_Lili_010415_3
## 6                                            Cousin_3_Lili_010415_4
##                    Col2    ID.de.la.personne. Col4 Col5 Col6 Col7 Col8
## 1                  <NA> Numéro de la personne    1    2    3    4    5
## 2 Numéro de la personne                   NOM   NA   NA   NA   NA   NA
## 3                     1               Colette   NA    2    2    2    1
## 4                     2                Thomas   NA   NA    2    2    2
## 5                     3                   Dan   NA   NA   NA    2    2
## 6                     4                Marine   NA   NA   NA   NA    2
##   Col9 Col10 Col11 Col12 Col13 Col14 Col15 Col16 Col17 Col18 Col19 Col20
## 1    6     7     8     9    10    11    12    13    14    15    16    17
## 2   NA    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA
## 3    1     2     1     1     2     2     2     2     2     1     1     1
## 4    2     2     2     2     2     2     2     2     1     1     1     1
## 5    2     2     2     2     2     2     2     2     2     2     2     1
## 6    2     2     2     1     2     2     2     2     1     1     1     1
##   Col21 Col22 Col23 Col24 Col25 Col26 Col27 Col28 Col29 Col30 Col31 Col32
## 1    18    19    20    21    22    23    24    25    26    27    28    29
## 2    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA    NA
## 3     1     1     1     1     1     1     1     1     1     1     1     1
## 4     1     2     1     1     1     1     1     1     1     1     1     1
## 5     1     2     2     2     2     2     2     2     2     2     2     2
## 6     1     2     2     1     1     1     1     1     1     1     1     1
##   Col33
## 1    30
## 2    NA
## 3     1
## 4     1
## 5     2
## 6     1

Folder selection

setwd("C:/Users/Antoine/Downloads/Statistiques_REPIN-2015-10-27/Statistiques REPIN")

Listing excel files

temp = list.files(pattern="*.xls")

Importing worksheets

sheet1 <-lapply(temp, readWorksheetFromFile, sheet = 1)
sheet2 <-lapply(temp, readWorksheetFromFile, sheet = 2)
sheet3 <-lapply(temp, readWorksheetFromFile, sheet = 3)
sheet4 <-lapply(temp, readWorksheetFromFile, sheet = 4)
sheet5 <-lapply(temp, readWorksheetFromFile, sheet = 5)