library(tidyverse)
library(sf)

INFORMACIÓN GEOGRÁFICA DE LA CIUDAD DE LONDRES

Los datos de shapes de los distritos de Londres fueron tomadas de https://joshuaboyd1.carto.com/tables/london_boroughs_proper/public/map

Mientras que otros datos estadísticos de Londres fueron tomados del portal de datos abiertos de dicha ciudad https://data.london.gov.uk/

Definimos un dataframe con las geometrias de los distritos de Londres con sus nombres

london_area <- st_read("london_boroughs_proper.geojson", stringsAsFactors=TRUE)
## Reading layer `london_boroughs_proper' from data source `C:\Users\LUIS.PEREZ\Documents\Modulo2\london_boroughs_proper.geojson' using driver `GeoJSON'
## Simple feature collection with 33 features and 4 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: -0.508813 ymin: 51.28691 xmax: 0.335677 ymax: 51.69207
## Geodetic CRS:  WGS 84
head(london_area, 10)
## Simple feature collection with 10 features and 4 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: -0.41808 ymin: 51.28691 xmax: 0.225322 ymax: 51.69207
## Geodetic CRS:  WGS 84
##                    name cartodb_id          created_at          updated_at
## 1  Barking and Dagenham          1 2015-07-01 06:57:45 2015-07-01 06:57:45
## 2                Barnet          2 2015-07-01 06:57:45 2015-07-01 06:57:45
## 3                Bexley          3 2015-07-01 06:57:45 2015-07-01 06:57:45
## 4                 Brent          4 2015-07-01 06:57:45 2015-07-01 06:57:45
## 5               Bromley          5 2015-07-01 06:57:45 2015-07-01 06:57:45
## 6                Camden          6 2015-07-01 06:57:45 2015-07-01 06:57:45
## 7        City of London          7 2015-07-01 06:57:45 2015-07-01 06:57:45
## 8               Croydon          8 2015-07-01 06:57:45 2015-07-01 06:57:45
## 9                Ealing          9 2015-07-01 06:57:45 2015-07-01 06:57:45
## 10              Enfield         10 2015-07-01 06:57:45 2015-07-01 06:57:45
##                          geometry
## 1  MULTIPOLYGON (((0.148209 51...
## 2  MULTIPOLYGON (((-0.183361 5...
## 3  MULTIPOLYGON (((0.158044 51...
## 4  MULTIPOLYGON (((-0.212138 5...
## 5  MULTIPOLYGON (((0.076463 51...
## 6  MULTIPOLYGON (((-0.140804 5...
## 7  MULTIPOLYGON (((-0.083712 5...
## 8  MULTIPOLYGON (((-0.077495 5...
## 9  MULTIPOLYGON (((-0.334018 5...
## 10 MULTIPOLYGON (((-0.010576 5...
str(london_area)
## Classes 'sf' and 'data.frame':   33 obs. of  5 variables:
##  $ name      : Factor w/ 33 levels "Barking and Dagenham",..: 1 2 3 4 5 6 7 8 9 10 ...
##  $ cartodb_id: int  1 2 3 4 5 6 7 8 9 10 ...
##  $ created_at: POSIXct, format: "2015-07-01 06:57:45" "2015-07-01 06:57:45" ...
##  $ updated_at: POSIXct, format: "2015-07-01 06:57:45" "2015-07-01 06:57:45" ...
##  $ geometry  :sfc_MULTIPOLYGON of length 33; first list element: List of 1
##   ..$ :List of 1
##   .. ..$ : num [1:1205, 1:2] 0.148 0.148 0.147 0.144 0.144 ...
##   ..- attr(*, "class")= chr [1:3] "XY" "MULTIPOLYGON" "sfg"
##  - attr(*, "sf_column")= chr "geometry"
##  - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA
##   ..- attr(*, "names")= chr [1:4] "name" "cartodb_id" "created_at" "updated_at"
summary(london_area)
##                    name      cartodb_id   created_at                 
##  Barking and Dagenham: 1   Min.   : 1   Min.   :2015-07-01 06:57:45  
##  Barnet              : 1   1st Qu.: 9   1st Qu.:2015-07-01 06:57:45  
##  Bexley              : 1   Median :17   Median :2015-07-01 06:57:45  
##  Brent               : 1   Mean   :17   Mean   :2015-07-01 06:57:45  
##  Bromley             : 1   3rd Qu.:25   3rd Qu.:2015-07-01 06:57:45  
##  Camden              : 1   Max.   :33   Max.   :2015-07-01 06:57:45  
##  (Other)             :27                                             
##    updated_at                           geometry 
##  Min.   :2015-07-01 06:57:45   MULTIPOLYGON :33  
##  1st Qu.:2015-07-01 06:57:45   epsg:4326    : 0  
##  Median :2015-07-01 06:57:45   +proj=long...: 0  
##  Mean   :2015-07-01 06:57:45                     
##  3rd Qu.:2015-07-01 06:57:45                     
##  Max.   :2015-07-01 06:57:45                     
## 

Primer esquema

ggplot(london_area)+
  geom_sf()

Le asociamos etiquetas para identificar espacialmente cada distrito

ggplot(london_area)+
  geom_sf()+
  labs(title="Distritos de Londres",
       x="longitud",
       y="latitud")+
  geom_sf_label(aes(label=name), size=1.8)
## Warning in st_point_on_surface.sfc(sf::st_zm(x)): st_point_on_surface may not
## give correct results for longitude/latitude data

Como información representativa, en particular en terminos poblacionales, de los distritos de Londres tomamos un dataset del portal de Datos Abiertos de la ciudad

london_prof <- read.csv("london-borough-profiles.csv", stringsAsFactors = TRUE)
dim(london_prof)
## [1] 38 84
head(london_prof)
##        Code            Area_name Inner._Outer_London
## 1 E09000001       City of London        Inner London
## 2 E09000002 Barking and Dagenham        Outer London
## 3 E09000003               Barnet        Outer London
## 4 E09000004               Bexley        Outer London
## 5 E09000005                Brent        Outer London
## 6 E09000006              Bromley        Outer London
##   GLA_Population_Estimate_2017 GLA_Household_Estimate_2017
## 1                         8800                        5326
## 2                       209000                       78188
## 3                       389600                      151423
## 4                       244300                       97736
## 5                       332100                      121048
## 6                       327900                      140602
##   Inland_Area_.Hectares. Population_density_.per_hectare._2017
## 1                    290                                  30.3
## 2                  3,611                                  57.9
## 3                  8,675                                  44.9
## 4                  6,058                                  40.3
## 5                  4,323                                  76.8
## 6                 15,013                                  21.8
##   Average_Age._2017 Proportion_of_population_aged_0.15._2015
## 1              43.2                                     11.4
## 2              32.9                                     27.2
## 3              37.3                                     21.1
## 4              39.0                                     20.6
## 5              35.6                                     20.9
## 6              40.2                                     19.9
##   Proportion_of_population_of_working.age._2015
## 1                                          73.1
## 2                                          63.1
## 3                                          64.9
## 4                                          62.9
## 5                                          67.8
## 6                                          62.6
##   Proportion_of_population_aged_65_and_over._2015 Net_internal_migration_.2015.
## 1                                            15.5                            -7
## 2                                             9.7                         -1176
## 3                                            14.0                         -3379
## 4                                            16.6                           413
## 5                                            11.3                         -7739
## 6                                            17.5                          1342
##   Net_international_migration_.2015. Net_natural_change_.2015.
## 1                                665                        30
## 2                               2509                      2356
## 3                               5407                      2757
## 4                                760                      1095
## 5                               7640                      3372
## 6                                796                      1445
##   X._of_resident_population_born_abroad_.2015.
## 1                                            .
## 2                                         37.8
## 3                                         35.2
## 4                                         16.1
## 5                                         53.9
## 6                                         18.3
##   Largest_migrant_population_by_country_of_birth_.2011.
## 1                                         United States
## 2                                               Nigeria
## 3                                                 India
## 4                                               Nigeria
## 5                                                 India
## 6                                                 India
##   X._of_largest_migrant_population_.2011.
## 1                                     2.8
## 2                                     4.7
## 3                                     3.1
## 4                                     2.6
## 5                                     9.2
## 6                                     1.1
##   Second_largest_migrant_population_by_country_of_birth_.2011.
## 1                                                       France
## 2                                                        India
## 3                                                       Poland
## 4                                                        India
## 5                                                       Poland
## 6                                                      Ireland
##   X._of_second_largest_migrant_population_.2011.
## 1                                              2
## 2                                            2.3
## 3                                            2.4
## 4                                            1.5
## 5                                            3.4
## 6                                            1.1
##   Third_largest_migrant_population_by_country_of_birth_.2011.
## 1                                                   Australia
## 2                                                    Pakistan
## 3                                                        Iran
## 4                                                     Ireland
## 5                                                     Ireland
## 6                                                     Nigeria
##   X._of_third_largest_migrant_population_.2011.
## 1                                           1.9
## 2                                           2.3
## 3                                             2
## 4                                           0.9
## 5                                           2.9
## 6                                           0.7
##   X._of_population_from_BAME_groups_.2016.
## 1                                     27.5
## 2                                     49.5
## 3                                     38.7
## 4                                     21.4
## 5                                     64.9
## 6                                     18.9
##   X._people_aged_3._whose_main_language_is_not_English_.2011_Census.
## 1                                                               17.1
## 2                                                               18.7
## 3                                                               23.4
## 4                                                                  6
## 5                                                               37.2
## 6                                                                5.8
##   Overseas_nationals_entering_the_UK_.NINo.._.2015.16.
## 1                                                  975
## 2                                                7,538
## 3                                               13,094
## 4                                                2,198
## 5                                               22,162
## 6                                                2,924
##   New_migrant_.NINo._rates._.2015.16.
## 1                               152.2
## 2                                59.1
## 3                                53.1
## 4                                14.4
## 5                               100.9
## 6                                14.4
##   Largest_migrant_population_arrived_during_2015.16
## 1                                             India
## 2                                           Romania
## 3                                           Romania
## 4                                           Romania
## 5                                           Romania
## 6                                           Romania
##   Second_largest_migrant_population_arrived_during_2015.16
## 1                                                   France
## 2                                                 Bulgaria
## 3                                                   Poland
## 4                                                   Poland
## 5                                                    Italy
## 6                                                    Italy
##   Third_largest_migrant_population_arrived_during_2015.16
## 1                                           United States
## 2                                               Lithuania
## 3                                                   Italy
## 4                                                 Nigeria
## 5                                                Portugal
## 6                                                   Spain
##   Employment_rate_..._.2015. Male_employment_rate_.2015.
## 1                       64.6                           .
## 2                       65.8                        75.6
## 3                       68.5                        74.5
## 4                       75.1                        82.1
## 5                       69.5                          76
## 6                       75.3                        80.4
##   Female_employment_rate_.2015. Unemployment_rate_.2015.
## 1                             .                        .
## 2                          56.5                       11
## 3                          62.9                      8.5
## 4                          68.5                      7.6
## 5                          62.6                      7.5
## 6                          70.4                      5.3
##   Youth_Unemployment_.claimant._rate_18.24_.Dec.15.
## 1                                               1.6
## 2                                               4.5
## 3                                               1.9
## 4                                               2.9
## 5                                               3.1
## 6                                               2.5
##   Proportion_of_16.18_year_olds_who_are_NEET_..._.2014.
## 1                                                     .
## 2                                                   5.7
## 3                                                   2.5
## 4                                                   3.4
## 5                                                   2.6
## 6                                                   4.3
##   Proportion_of_the_working.age_population_who_claim_out.of.work_benefits_..._.May.2016.
## 1                                                                                    3.4
## 2                                                                                   10.5
## 3                                                                                    6.2
## 4                                                                                    6.8
## 5                                                                                    8.3
## 6                                                                                      6
##   X._working.age_with_a_disability_.2015.
## 1                                       .
## 2                                    17.2
## 3                                    14.9
## 4                                    15.9
## 5                                    17.7
## 6                                    15.9
##   Proportion_of_working_age_people_with_no_qualifications_..._2015
## 1                                                                .
## 2                                                             11.3
## 3                                                              5.2
## 4                                                             10.8
## 5                                                              6.2
## 6                                                              4.3
##   Proportion_of_working_age_with_degree_or_equivalent_and_above_..._2015
## 1                                                                      .
## 2                                                                   32.2
## 3                                                                     49
## 4                                                                   33.5
## 5                                                                   45.1
## 6                                                                   46.7
##   Gross_Annual_Pay._.2016. Gross_Annual_Pay_._Male_.2016.
## 1                        .                              .
## 2                    27886                          30104
## 3                    33443                          36475
## 4                    34350                          37881
## 5                    29812                          30129
## 6                    37682                          42026
##   Gross_Annual_Pay_._Female_.2016.
## 1                                .
## 2                            24602
## 3                            31235
## 4                            28924
## 5                            29600
## 6                            32491
##   Modelled_Household_median_income_estimates_2012.13
## 1                                            £63,620
## 2                                            £29,420
## 3                                            £40,530
## 4                                            £36,990
## 5                                            £32,140
## 6                                            £43,060
##   X._adults_that_volunteered_in_past_12_months_.2010.11_to_2012.13.
## 1                                                                 .
## 2                                                              20.5
## 3                                                              33.2
## 4                                                              22.1
## 5                                                              17.3
## 6                                                                29
##   Number_of_jobs_by_workplace_.2014.
## 1                             500400
## 2                              58900
## 3                             167300
## 4                              80700
## 5                             133600
## 6                             127800
##   X._of_employment_that_is_in_public_sector_.2014. Jobs_Density._2015
## 1                                              3.4               84.3
## 2                                             21.1                0.5
## 3                                             18.7                0.7
## 4                                             15.9                0.6
## 5                                             17.6                0.6
## 6                                             13.9                0.6
##   Number_of_active_businesses._2015
## 1                             26130
## 2                              6560
## 3                             26190
## 4                              9075
## 5                             15745
## 6                             15695
##   Two.year_business_survival_rates_.started_in_2013.
## 1                                               64.3
## 2                                               73.0
## 3                                               73.8
## 4                                               73.5
## 5                                               74.4
## 6                                               78.6
##   Crime_rates_per_thousand_population_2014.15
## 1                                           .
## 2                                        83.4
## 3                                        62.7
## 4                                        51.8
## 5                                        78.8
## 6                                        64.1
##   Fires_per_thousand_population_.2014.
## 1                                 12.3
## 2                                    3
## 3                                  1.6
## 4                                  2.3
## 5                                  1.8
## 6                                  2.3
##   Ambulance_incidents_per_hundred_population_.2014. Median_House_Price._2015
## 1                                                 .                   799999
## 2                                              13.7                   243500
## 3                                              11.1                   445000
## 4                                              11.8                   275000
## 5                                              12.1                   407250
## 6                                              11.2                   374975
##   Average_Band_D_Council_Tax_charge_...._2015.16
## 1                                          931.2
## 2                                        1354.03
## 3                                        1397.07
## 4                                        1472.43
## 5                                        1377.24
## 6                                        1347.27
##   New_Homes_.net._2015.16_.provisional. Homes_Owned_outright._.2014._.
## 1                                    80                              .
## 2                                   730                           16.4
## 3                                  1460                           32.4
## 4                                  -130                           38.1
## 5                                  1050                           22.2
## 6                                   700                           37.8
##   Being_bought_with_mortgage_or_loan._.2014._.
## 1                                            .
## 2                                         27.4
## 3                                         25.2
## 4                                         35.3
## 5                                         22.6
## 6                                         34.9
##   Rented_from_Local_Authority_or_Housing_Association._.2014._.
## 1                                                            .
## 2                                                         35.9
## 3                                                         11.1
## 4                                                         15.2
## 5                                                         20.4
## 6                                                         13.2
##   Rented_from_Private_landlord._.2014._. X._of_area_that_is_Greenspace._2005
## 1                                      .                                 4.8
## 2                                   20.3                                33.6
## 3                                   31.1                                41.3
## 4                                   11.4                                31.7
## 5                                   34.8                                21.9
## 6                                   14.1                                57.8
##   Total_carbon_emissions_.2014. Household_Waste_Recycling_Rate._2014.15
## 1                          1036                                    34.4
## 2                           644                                    23.4
## 3                          1415                                      38
## 4                           975                                      54
## 5                          1175                                    35.2
## 6                          1180                                      48
##   Number_of_cars._.2011_Census. Number_of_cars_per_household._.2011_Census.
## 1                          1692                                         0.4
## 2                         56966                                         0.8
## 3                        144717                                         1.1
## 4                        108507                                         1.2
## 5                         87802                                         0.8
## 6                        153908                                         1.2
##   X._of_adults_who_cycle_at_least_once_per_month._2014.15
## 1                                                    16.9
## 2                                                     8.8
## 3                                                     7.4
## 4                                                    10.6
## 5                                                     7.9
## 6                                                      13
##   Average_Public_Transport_Accessibility_score._2014
## 1                                                7.9
## 2                                                  3
## 3                                                  3
## 4                                                2.6
## 5                                                3.7
## 6                                                2.8
##   Achievement_of_5_or_more_A.._C_grades_at_GCSE_or_equivalent_including_English_and_Maths._2013.14
## 1                                                                                             78.6
## 2                                                                                               58
## 3                                                                                             67.3
## 4                                                                                             60.3
## 5                                                                                             60.1
## 6                                                                                               68
##   Rates_of_Children_Looked_After_.2016.
## 1                                   101
## 2                                    69
## 3                                    35
## 4                                    46
## 5                                    45
## 6                                    40
##   X._of_pupils_whose_first_language_is_not_English_.2015.
## 1                                                       .
## 2                                                    41.7
## 3                                                      46
## 4                                                    32.6
## 5                                                    37.6
## 6                                                    38.9
##   X._children_living_in_out.of.work_households_.2015.
## 1                                                 7.9
## 2                                                18.7
## 3                                                 9.3
## 4                                                12.6
## 5                                                13.7
## 6                                                10.2
##   Male_life_expectancy._.2012.14. Female_life_expectancy._.2012.14.
## 1                               .                                 .
## 2                            77.6                              82.1
## 3                            82.1                              85.1
## 4                            80.4                              84.4
## 5                            80.1                              85.1
## 6                            81.4                              84.9
##   Teenage_conception_rate_.2014. Life_satisfaction_score_2011.14_.out_of_10.
## 1                              .                                         6.6
## 2                           32.4                                         7.1
## 3                           12.8                                         7.5
## 4                           19.5                                         7.4
## 5                           18.5                                         7.3
## 6                           16.7                                         7.5
##   Worthwhileness_score_2011.14_.out_of_10. Happiness_score_2011.14_.out_of_10.
## 1                                      7.1                                 6.0
## 2                                      7.6                                 7.1
## 3                                      7.8                                 7.4
## 4                                      7.7                                 7.2
## 5                                      7.4                                 7.2
## 6                                      7.9                                 7.4
##   Anxiety_score_2011.14_.out_of_10. Childhood_Obesity_Prevalance_..._2015.16
## 1                               5.6                                      n/a
## 2                               3.1                                     28.5
## 3                               2.8                                     20.7
## 4                               3.3                                     22.7
## 5                               2.9                                     24.3
## 6                               3.3                                       16
##   People_aged_17._with_diabetes_...
## 1                               2.6
## 2                               7.3
## 3                                 6
## 4                               6.9
## 5                               7.9
## 6                               5.2
##   Mortality_rate_from_causes_considered_preventable_2012.14
## 1                                                       129
## 2                                                       228
## 3                                                       134
## 4                                                       164
## 5                                                       169
## 6                                                       148
##   Political_control_in_council
## 1                            .
## 2                          Lab
## 3                         Cons
## 4                         Cons
## 5                          Lab
## 6                         Cons
##   Proportion_of_seats_won_by_Conservatives_in_2014_election
## 1                                                         .
## 2                                                         0
## 3                                                      50.8
## 4                                                      71.4
## 5                                                       9.5
## 6                                                        85
##   Proportion_of_seats_won_by_Labour_in_2014_election
## 1                                                  .
## 2                                                100
## 3                                                  .
## 4                                               23.8
## 5                                               88.9
## 6                                               11.7
##   Proportion_of_seats_won_by_Lib_Dems_in_2014_election
## 1                                                    .
## 2                                                    0
## 3                                                  1.6
## 4                                                    0
## 5                                                  1.6
## 6                                                    0
##   Turnout_at_2014_local_elections
## 1                               .
## 2                            36.5
## 3                            40.5
## 4                            39.6
## 5                            36.3
## 6                            40.8
summary(london_prof)
##         Code                   Area_name    Inner._Outer_London
##  E09000001: 1   Barking and Dagenham: 1               : 5      
##  E09000002: 1   Barnet              : 1   Inner London:14      
##  E09000003: 1   Bexley              : 1   Outer London:19      
##  E09000004: 1   Brent               : 1                        
##  E09000005: 1   Bromley             : 1                        
##  E09000006: 1   Camden              : 1                        
##  (Other)  :32   (Other)             :32                        
##  GLA_Population_Estimate_2017 GLA_Household_Estimate_2017
##  Min.   :    8800             .      : 2                 
##  1st Qu.:  242200             104098 : 1                 
##  Median :  290550             105038 : 1                 
##  Mean   : 3897766             105887 : 1                 
##  3rd Qu.:  332775             105981 : 1                 
##  Max.   :65999100             107654 : 1                 
##                               (Other):31                 
##  Inland_Area_.Hectares. Population_density_.per_hectare._2017 Average_Age._2017
##  .      : 1             .      : 2                            Min.   :31.40    
##  1,212  : 1             108.9  : 1                            1st Qu.:35.00    
##  1,486  : 1             110.7  : 1                            Median :36.25    
##  1,640  : 1             111.3  : 1                            Mean   :36.53    
##  1,905  : 1             112.7  : 1                            3rd Qu.:38.15    
##  1,978  : 1             113    : 1                            Max.   :43.20    
##  (Other):32             (Other):31                                             
##  Proportion_of_population_aged_0.15._2015
##  Min.   :11.40                           
##  1st Qu.:18.00                           
##  Median :20.55                           
##  Mean   :20.07                           
##  3rd Qu.:21.25                           
##  Max.   :38.50                           
##                                          
##  Proportion_of_population_of_working.age._2015
##  Min.   :54.70                                
##  1st Qu.:64.50                                
##  Median :67.65                                
##  Mean   :67.87                                
##  3rd Qu.:72.00                                
##  Max.   :75.30                                
##                                               
##  Proportion_of_population_aged_65_and_over._2015 Net_internal_migration_.2015.
##  Min.   : 6.00                                   -1176  : 1                   
##  1st Qu.: 9.40                                   -1192  : 1                   
##  Median :12.00                                   -1480  : 1                   
##  Mean   :12.06                                   -1536  : 1                   
##  3rd Qu.:14.45                                   -1572  : 1                   
##  Max.   :18.40                                   -1616  : 1                   
##                                                  (Other):32                   
##  Net_international_migration_.2015. Net_natural_change_.2015.
##  .      : 1                         .      : 1               
##  10532  : 1                         1047   : 1               
##  10763  : 1                         1095   : 1               
##  1077   : 1                         1207   : 1               
##  11182  : 1                         1269   : 1               
##  1296   : 1                         1391   : 1               
##  (Other):32                         (Other):32               
##  X._of_resident_population_born_abroad_.2015.
##  36.6   : 2                                  
##  .      : 1                                  
##  10.9   : 1                                  
##  13.3   : 1                                  
##  14.6   : 1                                  
##  16.1   : 1                                  
##  (Other):31                                  
##  Largest_migrant_population_by_country_of_birth_.2011.
##  India        :13                                     
##  Nigeria      : 4                                     
##  United States: 4                                     
##  Ireland      : 3                                     
##  Poland       : 3                                     
##  Bangladesh   : 2                                     
##  (Other)      : 9                                     
##  X._of_largest_migrant_population_.2011.
##  2.8    : 3                             
##  3.6    : 3                             
##  1.1    : 2                             
##  1.8    : 2                             
##  2.2    : 2                             
##  3.2    : 2                             
##  (Other):24                             
##  Second_largest_migrant_population_by_country_of_birth_.2011.
##  Poland    : 8                                               
##  India     : 7                                               
##  France    : 3                                               
##  Bangladesh: 2                                               
##  Ireland   : 2                                               
##  Jamaica   : 2                                               
##  (Other)   :14                                               
##  X._of_second_largest_migrant_population_.2011.
##  1.8    : 4                                    
##  2.7    : 3                                    
##  1.1    : 2                                    
##  1.5    : 2                                    
##  1.9    : 2                                    
##  2      : 2                                    
##  (Other):23                                    
##  Third_largest_migrant_population_by_country_of_birth_.2011.
##  Ireland  :10                                               
##  Pakistan : 5                                               
##  Poland   : 3                                               
##  Australia: 2                                               
##  Jamaica  : 2                                               
##  Nigeria  : 2                                               
##  (Other)  :14                                               
##  X._of_third_largest_migrant_population_.2011.
##  1.6    : 4                                   
##  1.7    : 4                                   
##  0.9    : 3                                   
##  1.4    : 3                                   
##  1.9    : 3                                   
##  2.3    : 3                                   
##  (Other):18                                   
##  X._of_population_from_BAME_groups_.2016.
##  .      : 2                              
##  15.7   : 2                              
##  45.7   : 2                              
##  49.9   : 2                              
##  18.9   : 1                              
##  21.4   : 1                              
##  (Other):28                              
##  X._people_aged_3._whose_main_language_is_not_English_.2011_Census.
##  .      : 1                                                        
##  10     : 1                                                        
##  10.4   : 1                                                        
##  14.5   : 1                                                        
##  16.4   : 1                                                        
##  16.5   : 1                                                        
##  (Other):32                                                        
##  Overseas_nationals_entering_the_UK_.NINo.._.2015.16.
##  10,384 : 1                                          
##  10,427 : 1                                          
##  10,534 : 1                                          
##  11,259 : 1                                          
##  11,336 : 1                                          
##  12,157 : 1                                          
##  (Other):32                                          
##  New_migrant_.NINo._rates._.2015.16.
##  Min.   : 14.40                     
##  1st Qu.: 36.25                     
##  Median : 53.30                     
##  Mean   : 53.46                     
##  3rd Qu.: 65.35                     
##  Max.   :152.20                     
##                                     
##  Largest_migrant_population_arrived_during_2015.16
##  Bulgaria: 1                                      
##  India   : 1                                      
##  Italy   :10                                      
##  Poland  : 2                                      
##  Romania :22                                      
##  Spain   : 2                                      
##                                                   
##  Second_largest_migrant_population_arrived_during_2015.16
##  France  :8                                              
##  Poland  :8                                              
##  Italy   :6                                              
##  Bulgaria:5                                              
##  India   :4                                              
##  Romania :4                                              
##  (Other) :3                                              
##  Third_largest_migrant_population_arrived_during_2015.16
##  Spain    :10                                           
##  Italy    : 8                                           
##  Poland   : 8                                           
##  Bulgaria : 4                                           
##  Australia: 1                                           
##  France   : 1                                           
##  (Other)  : 6                                           
##  Employment_rate_..._.2015. Male_employment_rate_.2015.
##  Min.   :64.60              79.1   : 2                 
##  1st Qu.:69.72              80.3   : 2                 
##  Median :73.15              80.4   : 2                 
##  Mean   :72.78              80.9   : 2                 
##  3rd Qu.:75.25              82.1   : 2                 
##  Max.   :79.60              .      : 1                 
##                             (Other):27                 
##  Female_employment_rate_.2015. Unemployment_rate_.2015.
##  68.5   : 2                    5.3    : 3              
##  68.6   : 2                    5.7    : 3              
##  .      : 1                    5.9    : 3              
##  56.1   : 1                    3.8    : 2              
##  56.5   : 1                    4.5    : 2              
##  57.6   : 1                    4.6    : 2              
##  (Other):30                    (Other):23              
##  Youth_Unemployment_.claimant._rate_18.24_.Dec.15.
##  4.1    : 4                                       
##  2.4    : 2                                       
##  2.5    : 2                                       
##  2.9    : 2                                       
##  3.1    : 2                                       
##  3.2    : 2                                       
##  (Other):24                                       
##  Proportion_of_16.18_year_olds_who_are_NEET_..._.2014.
##  3.4    : 4                                           
##  4.3    : 4                                           
##  3      : 3                                           
##  3.3    : 3                                           
##  .      : 2                                           
##  2.2    : 2                                           
##  (Other):20                                           
##  Proportion_of_the_working.age_population_who_claim_out.of.work_benefits_..._.May.2016.
##  10.5   : 2                                                                            
##  6      : 2                                                                            
##  7      : 2                                                                            
##  8.5    : 2                                                                            
##  8.8    : 2                                                                            
##  .      : 1                                                                            
##  (Other):27                                                                            
##  X._working.age_with_a_disability_.2015.
##  15.9   : 2                             
##  16.1   : 2                             
##  17.5   : 2                             
##  17.9   : 2                             
##  .      : 1                             
##  10.8   : 1                             
##  (Other):28                             
##  Proportion_of_working_age_people_with_no_qualifications_..._2015
##  4.3    : 3                                                      
##  6.2    : 3                                                      
##  10.8   : 2                                                      
##  4.5    : 2                                                      
##  5.2    : 2                                                      
##  7.3    : 2                                                      
##  (Other):24                                                      
##  Proportion_of_working_age_with_degree_or_equivalent_and_above_..._2015
##  43.4   : 2                                                            
##  44.7   : 2                                                            
##  49.2   : 2                                                            
##  .      : 1                                                            
##  26     : 1                                                            
##  32.2   : 1                                                            
##  (Other):29                                                            
##  Gross_Annual_Pay._.2016. Gross_Annual_Pay_._Male_.2016.
##  .      : 4               .      :12                    
##  27886  : 1               30104  : 1                    
##  27942  : 1               30129  : 1                    
##  28213  : 1               30141  : 1                    
##  28503  : 1               30567  : 1                    
##  29812  : 1               30943  : 1                    
##  (Other):29               (Other):21                    
##  Gross_Annual_Pay_._Female_.2016.
##  .      : 6                      
##  24006  : 1                      
##  24602  : 1                      
##  24833  : 1                      
##  24965  : 1                      
##  27226  : 1                      
##  (Other):27                      
##  Modelled_Household_median_income_estimates_2012.13
##  .      : 1                                        
##  £28,780: 1                                        
##  £29,420: 1                                        
##  £30,600: 1                                        
##  £32,140: 1                                        
##  £33,080: 1                                        
##  (Other):32                                        
##  X._adults_that_volunteered_in_past_12_months_.2010.11_to_2012.13.
##  .      : 4                                                       
##  31.1   : 2                                                       
##  16.9   : 1                                                       
##  17.3   : 1                                                       
##  17.4   : 1                                                       
##  19.2   : 1                                                       
##  (Other):28                                                       
##  Number_of_jobs_by_workplace_.2014.
##  .      : 1                        
##  111100 : 1                        
##  127800 : 1                        
##  128800 : 1                        
##  132800 : 1                        
##  133600 : 1                        
##  (Other):32                        
##  X._of_employment_that_is_in_public_sector_.2014. Jobs_Density._2015
##  Min.   : 3.40                                    Min.   : 0.400    
##  1st Qu.:14.43                                    1st Qu.: 0.600    
##  Median :16.95                                    Median : 0.700    
##  Mean   :17.17                                    Mean   : 3.113    
##  3rd Qu.:20.55                                    3rd Qu.: 1.000    
##  Max.   :27.30                                    Max.   :84.300    
##                                                                     
##  Number_of_active_businesses._2015
##  Min.   :   6560                  
##  1st Qu.:  12221                  
##  Median :  15348                  
##  Mean   : 174843                  
##  3rd Qu.:  21258                  
##  Max.   :2672025                  
##                                   
##  Two.year_business_survival_rates_.started_in_2013.
##  Min.   :63.80                                     
##  1st Qu.:73.00                                     
##  Median :74.40                                     
##  Mean   :73.78                                     
##  3rd Qu.:75.67                                     
##  Max.   :78.80                                     
##                                                    
##  Crime_rates_per_thousand_population_2014.15
##  .      : 2                                 
##  69.4   : 2                                 
##  77     : 2                                 
##  100.6  : 1                                 
##  104.6  : 1                                 
##  106.4  : 1                                 
##  (Other):29                                 
##  Fires_per_thousand_population_.2014.
##  1.8    : 4                          
##  2.2    : 4                          
##  2.5    : 4                          
##  2      : 3                          
##  2.1    : 3                          
##  2.3    : 3                          
##  (Other):17                          
##  Ambulance_incidents_per_hundred_population_.2014. Median_House_Price._2015
##  .      : 3                                        320000 : 2              
##  11.3   : 3                                        350000 : 2              
##  11.8   : 3                                        415000 : 2              
##  12.2   : 3                                        .      : 1              
##  11.1   : 2                                        1200000: 1              
##  12.1   : 2                                        209995 : 1              
##  (Other):22                                        (Other):29              
##  Average_Band_D_Council_Tax_charge_...._2015.16
##  .      : 5                                    
##  1003.81: 1                                    
##  1058.58: 1                                    
##  1196.85: 1                                    
##  1206.38: 1                                    
##  1240.54: 1                                    
##  (Other):28                                    
##  New_Homes_.net._2015.16_.provisional. Homes_Owned_outright._.2014._.
##  .      : 5                            22.2   : 2                    
##  240    : 2                            .      : 1                    
##  510    : 2                            10.1   : 1                    
##  910    : 2                            10.9   : 1                    
##  970    : 2                            11.1   : 1                    
##  -130   : 1                            14.6   : 1                    
##  (Other):24                            (Other):31                    
##  Being_bought_with_mortgage_or_loan._.2014._.
##  15.1   : 2                                  
##  19.8   : 2                                  
##  31.8   : 2                                  
##  34.9   : 2                                  
##  .      : 1                                  
##  11.6   : 1                                  
##  (Other):28                                  
##  Rented_from_Local_Authority_or_Housing_Association._.2014._.
##  16.7   : 2                                                  
##  17.2   : 2                                                  
##  .      : 1                                                  
##  10.7   : 1                                                  
##  11.1   : 1                                                  
##  11.3   : 1                                                  
##  (Other):30                                                  
##  Rented_from_Private_landlord._.2014._. X._of_area_that_is_Greenspace._2005
##  23.9   : 2                             34.6   : 2                         
##  33.1   : 2                             .      : 1                         
##  .      : 1                             12.4   : 1                         
##  11.4   : 1                             15.1   : 1                         
##  13.8   : 1                             15.2   : 1                         
##  14.1   : 1                             17.3   : 1                         
##  (Other):30                             (Other):31                         
##  Total_carbon_emissions_.2014. Household_Waste_Recycling_Rate._2014.15
##  .      : 2                    .      : 3                             
##  1014   : 1                    20.7   : 2                             
##  1032   : 1                    25.3   : 2                             
##  1036   : 1                    17.1   : 1                             
##  1038   : 1                    17.2   : 1                             
##  1091   : 1                    19.1   : 1                             
##  (Other):31                    (Other):28                             
##  Number_of_cars._.2011_Census. Number_of_cars_per_household._.2011_Census.
##  Min.   :    1692              Min.   :0.4000                             
##  1st Qu.:   60602              1st Qu.:0.5250                             
##  Median :   86360              Median :0.8000                             
##  Mean   : 1684820              Mean   :0.8263                             
##  3rd Qu.:  119148              3rd Qu.:1.1000                             
##  Max.   :30333100              Max.   :1.2000                             
##                                                                           
##  X._of_adults_who_cycle_at_least_once_per_month._2014.15
##  .      : 3                                             
##  14.7   : 2                                             
##  16     : 2                                             
##  16.9   : 2                                             
##  20.1   : 2                                             
##  7.9    : 2                                             
##  (Other):25                                             
##  Average_Public_Transport_Accessibility_score._2014
##  3      : 6                                        
##  2.9    : 3                                        
##  4.9    : 3                                        
##  .      : 2                                        
##  3.4    : 2                                        
##  4.3    : 2                                        
##  (Other):20                                        
##  Achievement_of_5_or_more_A.._C_grades_at_GCSE_or_equivalent_including_English_and_Maths._2013.14
##  .      : 3                                                                                      
##  59.9   : 2                                                                                      
##  68.7   : 2                                                                                      
##  55.7   : 1                                                                                      
##  56.3   : 1                                                                                      
##  56.8   : 1                                                                                      
##  (Other):28                                                                                      
##  Rates_of_Children_Looked_After_.2016.
##  35     : 2                           
##  41     : 2                           
##  42     : 2                           
##  43     : 2                           
##  45     : 2                           
##  46     : 2                           
##  (Other):26                           
##  X._of_pupils_whose_first_language_is_not_English_.2015.
##  .      : 2                                             
##  38.9   : 2                                             
##  57.6   : 2                                             
##  15.7   : 1                                             
##  25.2   : 1                                             
##  29.3   : 1                                             
##  (Other):29                                             
##  X._children_living_in_out.of.work_households_.2015.
##  Min.   : 0.80                                      
##  1st Qu.:10.55                                      
##  Median :13.85                                      
##  Mean   :13.80                                      
##  3rd Qu.:17.05                                      
##  Max.   :23.40                                      
##                                                     
##  Male_life_expectancy._.2012.14. Female_life_expectancy._.2012.14.
##  .      : 4                      .      : 4                       
##  79     : 3                      83.9   : 4                       
##  80.4   : 3                      84.2   : 3                       
##  78.5   : 2                      82.5   : 2                       
##  78.9   : 2                      83.3   : 2                       
##  80.1   : 2                      83.4   : 2                       
##  (Other):22                      (Other):21                       
##  Teenage_conception_rate_.2014. Life_satisfaction_score_2011.14_.out_of_10.
##  .      : 2                     Min.   :6.600                              
##  18.5   : 2                     1st Qu.:7.200                              
##  22.8   : 2                     Median :7.300                              
##  11     : 1                     Mean   :7.289                              
##  12.6   : 1                     3rd Qu.:7.400                              
##  12.8   : 1                     Max.   :7.600                              
##  (Other):29                                                                
##  Worthwhileness_score_2011.14_.out_of_10. Happiness_score_2011.14_.out_of_10.
##  Min.   :7.100                            Min.   :6.000                      
##  1st Qu.:7.500                            1st Qu.:7.200                      
##  Median :7.600                            Median :7.200                      
##  Mean   :7.574                            Mean   :7.216                      
##  3rd Qu.:7.700                            3rd Qu.:7.300                      
##  Max.   :7.900                            Max.   :7.600                      
##                                                                              
##  Anxiety_score_2011.14_.out_of_10. Childhood_Obesity_Prevalance_..._2015.16
##  Min.   :2.600                     -      : 3                              
##  1st Qu.:3.125                     21.3   : 2                              
##  Median :3.300                     23.8   : 2                              
##  Mean   :3.337                     27.6   : 2                              
##  3rd Qu.:3.400                     12.6   : 1                              
##  Max.   :5.600                     16     : 1                              
##                                    (Other):27                              
##  People_aged_17._with_diabetes_...
##  5.9    : 3                       
##  6.5    : 3                       
##  4.2    : 2                       
##  4.4    : 2                       
##  5      : 2                       
##  6      : 2                       
##  (Other):24                       
##  Mortality_rate_from_causes_considered_preventable_2012.14
##  .      : 3                                               
##  164    : 3                                               
##  134    : 2                                               
##  162    : 2                                               
##  169    : 2                                               
##  183    : 2                                               
##  (Other):24                                               
##       Political_control_in_council
##  .                  : 6           
##  Cons               : 9           
##  Lab                :20           
##  Lib Dem            : 1           
##  No Overall Control : 1           
##  Tower Hamlets First: 1           
##                                   
##  Proportion_of_seats_won_by_Conservatives_in_2014_election
##  0      : 5                                               
##  .      : 3                                               
##  11.1   : 1                                               
##  15.7   : 1                                               
##  16.7   : 1                                               
##  17.4   : 1                                               
##  (Other):26                                               
##  Proportion_of_seats_won_by_Labour_in_2014_election
##  .      : 4                                        
##  0      : 2                                        
##  100    : 2                                        
##  1.9    : 1                                        
##  11.7   : 1                                        
##  23.8   : 1                                        
##  (Other):27                                        
##  Proportion_of_seats_won_by_Lib_Dems_in_2014_election
##  0      :18                                          
##  .      : 3                                          
##  1.6    : 3                                          
##  1.7    : 1                                          
##  1.9    : 1                                          
##  15.8   : 1                                          
##  (Other):11                                          
##  Turnout_at_2014_local_elections
##  .      : 3                     
##  37.6   : 2                     
##  39.6   : 2                     
##  40.5   : 2                     
##  43.1   : 2                     
##  29.8   : 1                     
##  (Other):26

necesitamos hacer algunas modificaciones al data set London_prof para poder combinarlo con london_area

por un lado en London_prof hay 5 registros (la diferencia de filas entre ambos datasets) que, por lo que observamos al ver el contenido del archivo, son totalizadores interno y dos datos externos (los correspondientes a Inglaterra y al Reino Unido en general)

tampoco vamos a centrar nuestro análisis en todas las columnas (84) de london_prof, por lo cual seleccionaremos solo algunas para reducir el tamaño del set

por último necesitamos que las columnas que contienen los nombres de los distritos (bouroghs) tengan el mismo nombre para poder hacer el joint_left

london_prof_sel <- select(london_prof, Area_name:X._of_third_largest_migrant_population_.2011.)
london_prof_sel <- filter(london_prof_sel, !(Area_name %in% c("Inner London", "Outer London", "London", "England", "United Kingdom")))
london_prof_sel <- rename(london_prof_sel, name=Area_name)
head(london_prof_sel)
##                   name Inner._Outer_London GLA_Population_Estimate_2017
## 1       City of London        Inner London                         8800
## 2 Barking and Dagenham        Outer London                       209000
## 3               Barnet        Outer London                       389600
## 4               Bexley        Outer London                       244300
## 5                Brent        Outer London                       332100
## 6              Bromley        Outer London                       327900
##   GLA_Household_Estimate_2017 Inland_Area_.Hectares.
## 1                        5326                    290
## 2                       78188                  3,611
## 3                      151423                  8,675
## 4                       97736                  6,058
## 5                      121048                  4,323
## 6                      140602                 15,013
##   Population_density_.per_hectare._2017 Average_Age._2017
## 1                                  30.3              43.2
## 2                                  57.9              32.9
## 3                                  44.9              37.3
## 4                                  40.3              39.0
## 5                                  76.8              35.6
## 6                                  21.8              40.2
##   Proportion_of_population_aged_0.15._2015
## 1                                     11.4
## 2                                     27.2
## 3                                     21.1
## 4                                     20.6
## 5                                     20.9
## 6                                     19.9
##   Proportion_of_population_of_working.age._2015
## 1                                          73.1
## 2                                          63.1
## 3                                          64.9
## 4                                          62.9
## 5                                          67.8
## 6                                          62.6
##   Proportion_of_population_aged_65_and_over._2015 Net_internal_migration_.2015.
## 1                                            15.5                            -7
## 2                                             9.7                         -1176
## 3                                            14.0                         -3379
## 4                                            16.6                           413
## 5                                            11.3                         -7739
## 6                                            17.5                          1342
##   Net_international_migration_.2015. Net_natural_change_.2015.
## 1                                665                        30
## 2                               2509                      2356
## 3                               5407                      2757
## 4                                760                      1095
## 5                               7640                      3372
## 6                                796                      1445
##   X._of_resident_population_born_abroad_.2015.
## 1                                            .
## 2                                         37.8
## 3                                         35.2
## 4                                         16.1
## 5                                         53.9
## 6                                         18.3
##   Largest_migrant_population_by_country_of_birth_.2011.
## 1                                         United States
## 2                                               Nigeria
## 3                                                 India
## 4                                               Nigeria
## 5                                                 India
## 6                                                 India
##   X._of_largest_migrant_population_.2011.
## 1                                     2.8
## 2                                     4.7
## 3                                     3.1
## 4                                     2.6
## 5                                     9.2
## 6                                     1.1
##   Second_largest_migrant_population_by_country_of_birth_.2011.
## 1                                                       France
## 2                                                        India
## 3                                                       Poland
## 4                                                        India
## 5                                                       Poland
## 6                                                      Ireland
##   X._of_second_largest_migrant_population_.2011.
## 1                                              2
## 2                                            2.3
## 3                                            2.4
## 4                                            1.5
## 5                                            3.4
## 6                                            1.1
##   Third_largest_migrant_population_by_country_of_birth_.2011.
## 1                                                   Australia
## 2                                                    Pakistan
## 3                                                        Iran
## 4                                                     Ireland
## 5                                                     Ireland
## 6                                                     Nigeria
##   X._of_third_largest_migrant_population_.2011.
## 1                                           1.9
## 2                                           2.3
## 3                                             2
## 4                                           0.9
## 5                                           2.9
## 6                                           0.7

Estamos ahora en condición de combinarlos

london_area_full <- left_join(london_area, london_prof_sel, by="name")
head(london_area_full)
## Simple feature collection with 6 features and 23 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: -0.333999 ymin: 51.2895 xmax: 0.225322 ymax: 51.67036
## Geodetic CRS:  WGS 84
##                   name cartodb_id          created_at          updated_at
## 1 Barking and Dagenham          1 2015-07-01 06:57:45 2015-07-01 06:57:45
## 2               Barnet          2 2015-07-01 06:57:45 2015-07-01 06:57:45
## 3               Bexley          3 2015-07-01 06:57:45 2015-07-01 06:57:45
## 4                Brent          4 2015-07-01 06:57:45 2015-07-01 06:57:45
## 5              Bromley          5 2015-07-01 06:57:45 2015-07-01 06:57:45
## 6               Camden          6 2015-07-01 06:57:45 2015-07-01 06:57:45
##   Inner._Outer_London GLA_Population_Estimate_2017 GLA_Household_Estimate_2017
## 1        Outer London                       209000                       78188
## 2        Outer London                       389600                      151423
## 3        Outer London                       244300                       97736
## 4        Outer London                       332100                      121048
## 5        Outer London                       327900                      140602
## 6        Inner London                       242500                      107654
##   Inland_Area_.Hectares. Population_density_.per_hectare._2017
## 1                  3,611                                  57.9
## 2                  8,675                                  44.9
## 3                  6,058                                  40.3
## 4                  4,323                                  76.8
## 5                 15,013                                  21.8
## 6                  2,179                                 111.3
##   Average_Age._2017 Proportion_of_population_aged_0.15._2015
## 1              32.9                                     27.2
## 2              37.3                                     21.1
## 3              39.0                                     20.6
## 4              35.6                                     20.9
## 5              40.2                                     19.9
## 6              36.4                                     17.3
##   Proportion_of_population_of_working.age._2015
## 1                                          63.1
## 2                                          64.9
## 3                                          62.9
## 4                                          67.8
## 5                                          62.6
## 6                                          71.0
##   Proportion_of_population_aged_65_and_over._2015 Net_internal_migration_.2015.
## 1                                             9.7                         -1176
## 2                                            14.0                         -3379
## 3                                            16.6                           413
## 4                                            11.3                         -7739
## 5                                            17.5                          1342
## 6                                            11.7                         -2917
##   Net_international_migration_.2015. Net_natural_change_.2015.
## 1                               2509                      2356
## 2                               5407                      2757
## 3                                760                      1095
## 4                               7640                      3372
## 5                                796                      1445
## 6                               7504                      1618
##   X._of_resident_population_born_abroad_.2015.
## 1                                         37.8
## 2                                         35.2
## 3                                         16.1
## 4                                         53.9
## 5                                         18.3
## 6                                         41.4
##   Largest_migrant_population_by_country_of_birth_.2011.
## 1                                               Nigeria
## 2                                                 India
## 3                                               Nigeria
## 4                                                 India
## 5                                                 India
## 6                                         United States
##   X._of_largest_migrant_population_.2011.
## 1                                     4.7
## 2                                     3.1
## 3                                     2.6
## 4                                     9.2
## 5                                     1.1
## 6                                     2.8
##   Second_largest_migrant_population_by_country_of_birth_.2011.
## 1                                                        India
## 2                                                       Poland
## 3                                                        India
## 4                                                       Poland
## 5                                                      Ireland
## 6                                                   Bangladesh
##   X._of_second_largest_migrant_population_.2011.
## 1                                            2.3
## 2                                            2.4
## 3                                            1.5
## 4                                            3.4
## 5                                            1.1
## 6                                            2.7
##   Third_largest_migrant_population_by_country_of_birth_.2011.
## 1                                                    Pakistan
## 2                                                        Iran
## 3                                                     Ireland
## 4                                                     Ireland
## 5                                                     Nigeria
## 6                                                     Ireland
##   X._of_third_largest_migrant_population_.2011.                       geometry
## 1                                           2.3 MULTIPOLYGON (((0.148209 51...
## 2                                             2 MULTIPOLYGON (((-0.183361 5...
## 3                                           0.9 MULTIPOLYGON (((0.158044 51...
## 4                                           2.9 MULTIPOLYGON (((-0.212138 5...
## 5                                           0.7 MULTIPOLYGON (((0.076463 51...
## 6                                           2.4 MULTIPOLYGON (((-0.140804 5...

Distribución de población

Representaremos el mapa de lOndres según la población de cada distrito

ggplot(london_area_full)+
  geom_sf(aes(fill=GLA_Population_Estimate_2017))+
  labs(title="Mapa de Población Londres", 
       subtitle="por distrito, segun datos 2017",
       x="longitud",
       y="latitud")+
  scale_fill_distiller(palette = "Spectral")

El dataset divide a la cudad en un sector interno y otro externo Podemos ver como resulta en el “Londres interno” En este caso agregando las etiquetas de los nombres de los distritos

ggplot(london_area_full %>% filter(Inner._Outer_London=="Inner London"))+
  geom_sf(aes(fill=GLA_Population_Estimate_2017))+
  labs(title="Mapa de Población Londres", 
       subtitle="Inner London",
       x="longitud",
       y="latitud")+
  scale_fill_distiller(palette = "Spectral")+
  geom_sf_label(aes(label=name), size=1.8)
## Warning in st_point_on_surface.sfc(sf::st_zm(x)): st_point_on_surface may not
## give correct results for longitude/latitude data

Eliminando del análisis la City de Londres (el sector financiero) el distrito con menor población es Kesington and Chelsea, seguramente la zona más residencial de londres, predominantemente de casas bajas y donde residen la mayoría de las embajadas.

Distribución espacial de inmigrantes

Como parte de la información de población de los distritos, la columna “Largest_migrant_population_by_country_of_birth_.2011.” indica de que pais son originarios la primera mayoría de inmigrantes Podemos representarlo en el mapa de la siguiente manera

ggplot(london_area_full)+
  geom_sf(aes(fill=Largest_migrant_population_by_country_of_birth_.2011.))+
  labs(title="Mapa de Población Londres", subtitle="por distrito, segun datos 2017")

Como se puede observar aparecen claras agrupaciones por zonas, mientras en el noroeste y en el sur este hay mayoría de inmigrantes indúes, Candem y Westmister hay mayoría de inmigrantes de USA, al sur dos distritos tienen mayoría de inmigrantes de Sri Lanka y Enfield, al norte, inmigrantes procedentes de Turquia.