myDF <- read.csv2("./data/gemeenten.csv", sep = ";")
str(myDF)
'data.frame': 388 obs. of 10 variables:
$ Gemeenten : Factor w/ 388 levels "'s-Hertogenbosch",..: 2 3 4 5 6 7 8 9 10 11 ...
$ Bevolking.totaal : int 25286 13067 31373 27047 27893 20008 25105 108373 72479 200914 ...
$ Bevolking.totaal.vrouwen : int 12683 6452 15857 13422 13708 10199 12655 54714 36314 101241 ...
$ Bevolkingsdichtheid : int 91 246 972 279 268 1989 1057 924 1044 808 ...
$ Bevolking.totaal.mannen : int 12603 6615 15516 13625 14185 9809 12450 53659 36165 99673 ...
$ Gemiddelde.leeftijd.bevolking : num 46.5 39.6 41.3 43.5 41.3 40.5 41.1 41.8 41.7 37.5 ...
$ Gemiddelde.leeftijd.mannen : num 45.3 38.7 40.6 42.3 40.3 39.4 40.3 40.8 40.7 37 ...
$ Gemiddelde.leeftijd.vrouwen : num 47.6 40.6 42 44.7 42.3 41.6 41.8 42.8 42.7 37.9 ...
$ Bevolking.leeftijd..4.jaar : int 936 793 1607 1230 1482 1273 1369 5664 3596 12224 ...
$ Totaalscore.Leefbaarometer.2.0..label.: int 8 7 6 7 6 6 7 7 6 6 ...
summary(myDF)
Gemeenten Bevolking.totaal Bevolking.totaal.vrouwen Bevolkingsdichtheid
's-Hertogenbosch: 1 Min. : 941 Min. : 458 Min. : 3.0
Aa en Hunze : 1 1st Qu.: 17787 1st Qu.: 8856 1st Qu.: 202.5
Aalburg : 1 Median : 26856 Median : 13417 Median : 385.0
Aalsmeer : 1 Mean : 44024 Mean : 22182 Mean : 729.3
Aalten : 1 3rd Qu.: 44494 3rd Qu.: 22544 3rd Qu.: 858.2
Achtkarspelen : 1 Max. :844947 Max. :426820 Max. :5349.0
(Other) :382
Bevolking.totaal.mannen Gemiddelde.leeftijd.bevolking Gemiddelde.leeftijd.mannen
Min. : 483 Min. :31.50 Min. :30.90
1st Qu.: 8922 1st Qu.:41.60 1st Qu.:40.70
Median : 13276 Median :43.00 Median :42.00
Mean : 21843 Mean :42.88 Mean :41.96
3rd Qu.: 22239 3rd Qu.:44.30 3rd Qu.:43.33
Max. :418127 Max. :48.90 Max. :47.70
Gemiddelde.leeftijd.vrouwen Bevolking.leeftijd..4.jaar Totaalscore.Leefbaarometer.2.0..label.
Min. :32.00 Min. : 29 Min. :4.000
1st Qu.:42.40 1st Qu.: 824 1st Qu.:6.000
Median :43.90 Median : 1327 Median :7.000
Mean :43.79 Mean : 2248 Mean :6.946
3rd Qu.:45.20 3rd Qu.: 2178 3rd Qu.:7.000
Max. :50.10 Max. :47380 Max. :9.000
De dataset bevat gegevens van 388 gemeenten in Nederland.
p <- plot_ly(data = myDF,
x = ~Gemiddelde.leeftijd.bevolking,
y = ~Totaalscore.Leefbaarometer.2.0..label.,
type = 'scatter',
mode = 'markers',
marker = list(size = 12,
color = 'salmon',
line = list(color = 'tomato',
width = 2)
),
hoverinfo = 'text',
text = ~paste(Gemeenten,
'<br> Gem. leeft.: ', Gemiddelde.leeftijd.bevolking,
'<br> Leefbaar: ', Totaalscore.Leefbaarometer.2.0..label.),
width = 800
)
p
p <- plot_ly(data = myDF,
x = ~Bevolkingsdichtheid,
y = ~Totaalscore.Leefbaarometer.2.0..label.,
type = 'scatter', mode = 'markers',
marker = list(size = 12,
color = 'skyblue',
line = list(color = 'royalblue',
width = 2)
),
hoverinfo = 'text',
text = ~paste(Gemeenten,
'<br> Bevolkingsdichtheid: ', Bevolkingsdichtheid,
'<br> Leefbaar: ', Totaalscore.Leefbaarometer.2.0..label.),
width = 800
)
p