#setwd("I:/DataVisualisatie/EigenRepertoire")
library(readr)
setwd("C:/Users/hdhar/iCloudDrive/DataVisualisatie2020/EigenRepertoire")
arbuthnot<-(GeboortenLonden1629_1710 <- read_delim("GeboortenLonden1629-1710.csv",
";", escape_double = FALSE, trim_ws = TRUE))
## Warning: Missing column names filled in: 'X1' [1]
## Parsed with column specification:
## cols(
## X1 = col_double(),
## Jaar = col_double(),
## Jongens = col_double(),
## Meisjes = col_double()
## )
View(GeboortenLonden1629_1710)
View(arbuthnot)
# Teken een lijngrafiek
par(bg = "ghostwhite", bty="n", mar=c(5,5,5,2))
Aantal <- c(arbuthnot$Jaar)
plot(Aantal,ylim=c(2500,8500),xaxt="n",xlab="Jaren",las=1) #Teken eerst een plot(box)
#dan de lijnen
lines(arbuthnot$Meisjes,lwd=4,col="darkorange")
lines(arbuthnot$Jongens,lwd=4,col="steelblue1")
# plaats streepjes en labels op de xas. axis(side, at=, labels=, pos=, lty=, col=, las=, tck=, ...)
# side =1=bottom, 2=left, 3=top, 4=right)
# dit werkt alleen als je de standaard x-as op "n"hebt gezet, zie boven xaxt="n"
axis(1, at = c(1,12,32,46,52,72,76,82),
labels = c("1629","1640","1660","1674","1680","1700","1704","1710"))
# teken de vertikale lijnen op de speciale jaarplekken.
abline(v=1,lty="dotted",col = "gray90")
abline(v=12,lty="dotted",col = "gray90")
abline(v=32,lty="dotted",col = "gray90")
abline(v=52,lty="dotted",col = "gray90")
abline(v=72,lty="dotted",col = "gray90")
abline(v=82,lty="dotted",col = "gray90")
abline(v=76,lty="dotted",col="gray90")
abline(v=46,lty="dotted",col="gray90")
# Maakt een titel, blauw, bold font, links uitgelijnd op de y-as
title(main="In Londen geboren jongens en meisjes 1629 - 1710 (gegevens van doopfeesten).", col.main="gray20",font.main=2,adj=0)
text(82,7000,"Meisjes", col = "darkorange")
text(82,8500,"Jongens", col="steelblue1")
# legend(52,4000, # plaatst een legenda op de juiste plaats.
#
# c("Jongens","Meisjes"), # plaatst tekst in de legenda, volgorde op basis van uiteinden van de lijnen!
#
# lty=c(1,1), # geeft de legenda de juiste symbolen of lijnen.
#
# lwd=c(3.5,3.5),col=c("steelblue1","darkorange"), # gives the legend lines the correct color and width
#
# bty="n")
#plaats tekst linksonder op 4 lijnen beneden de yas, met grootte 0.8 een maak gray20 en lijn rechts uit.
mtext("Bron: John Arbuthnot (1710)", side=1,line=3, cex=0.8, col="gray20", adj=1)
Arbuthnot’s gegevens beschrijven mannelijke en vrouwelijke geboorten (doopfeestgegevens) voor Londen van 1629-1710. John Arbuthnot (1710) gebruikte deze tijdreeksgegevens om de eerste bekende significantietest uit te voeren. Tijdens elk van de 81 jaar, waren er meer mannelijke doo====pfeesten (geboorten) dan vrouwelijke doopfeesten. Zoals Arbuthnot zich afvroeg, kunnen we ons ook afvragen of dit aan toeval te wijten is,of dat dit betekende dat het geboortecijfer niet echt 1 : 1 was. Arbuthnot zag er de hand van een goddelijk wezen in. Vreemd is dat de data van 1674 en 1704 gelijk zijn (6113 en 5738,gekopieerd/bedacht/foutje?) 1639 - 1651 Engelse Burgeroorlog. 1666 Grote Brand van Londen. 1665 Pestepidemie 1630 en 1632 Pestepidemie
#
——————————————————scatterplot—-
library(readr)
arbuthnot <- read_delim("GeboortenLonden1629-1710.csv",
";", escape_double = FALSE, col_types = cols(X1 = col_skip()),
trim_ws = TRUE)
## Warning: Missing column names filled in: 'X1' [1]
#View(arbuthnot)
par(mfcol=c(1,2),bg="ghostwhite", las=1)
# scatterplot
plot(x = arbuthnot$Jaar, y = arbuthnot$Meisjes,xlim=c(1629,1710), main="Geboren meisjes 1629 - 1710 in totaal 453841")
plot(x = arbuthnot$Jaar, y = arbuthnot$Jongens,xlim=c(1629,1710), main="Geboren jongens 1629 - 1710 in totaal 484382")
sum(arbuthnot$Meisjes)
## [1] 453841
sum(arbuthnot$Jongens)
## [1] 484382
———————————-totaal aantal geborenen—-
library(readr)
arbuthnot <- read_delim("GeboortenLonden1629-1710.csv",
";", escape_double = FALSE, col_types = cols(X1 = col_skip()),
trim_ws = TRUE)
## Warning: Missing column names filled in: 'X1' [1]
#View(arbuthnot)
arbuthnot # toon alles
## # A tibble: 82 x 3
## Jaar Jongens Meisjes
## <dbl> <dbl> <dbl>
## 1 1629 5218 4683
## 2 1630 4858 4457
## 3 1631 4422 4102
## 4 1632 4994 4590
## 5 1633 5158 4839
## 6 1634 5035 4820
## 7 1635 5106 4928
## 8 1636 4917 4605
## 9 1637 4703 4457
## 10 1638 5359 4952
## # ... with 72 more rows
arbuthnot["Jaar"]
## # A tibble: 82 x 1
## Jaar
## <dbl>
## 1 1629
## 2 1630
## 3 1631
## 4 1632
## 5 1633
## 6 1634
## 7 1635
## 8 1636
## 9 1637
## 10 1638
## # ... with 72 more rows
arbuthnot[,c("Jongens","Meisjes")]
## # A tibble: 82 x 2
## Jongens Meisjes
## <dbl> <dbl>
## 1 5218 4683
## 2 4858 4457
## 3 4422 4102
## 4 4994 4590
## 5 5158 4839
## 6 5035 4820
## 7 5106 4928
## 8 4917 4605
## 9 4703 4457
## 10 5359 4952
## # ... with 72 more rows
b<-(arbuthnot[,c("Jongens")])
g<-(arbuthnot[,c("Meisjes")])
x<-b+g
x
## Jongens
## 1 9901
## 2 9315
## 3 8524
## 4 9584
## 5 9997
## 6 9855
## 7 10034
## 8 9522
## 9 9160
## 10 10311
## 11 10150
## 12 10850
## 13 10670
## 14 10370
## 15 9410
## 16 8104
## 17 7966
## 18 7163
## 19 7332
## 20 6544
## 21 5825
## 22 5612
## 23 6071
## 24 6128
## 25 6155
## 26 6620
## 27 7004
## 28 7050
## 29 6685
## 30 6170
## 31 5990
## 32 6971
## 33 8855
## 34 10019
## 35 10292
## 36 11722
## 37 9972
## 38 8997
## 39 10938
## 40 11633
## 41 12335
## 42 11997
## 43 12510
## 44 12563
## 45 11895
## 46 11851
## 47 11775
## 48 12399
## 49 12626
## 50 12601
## 51 12288
## 52 12847
## 53 13355
## 54 13653
## 55 14735
## 56 14702
## 57 14730
## 58 14694
## 59 14951
## 60 14588
## 61 14771
## 62 15211
## 63 15054
## 64 14918
## 65 15159
## 66 13632
## 67 13976
## 68 14861
## 69 15829
## 70 16052
## 71 15363
## 72 14639
## 73 15616
## 74 15687
## 75 15448
## 76 11851
## 77 16145
## 78 15369
## 79 16066
## 80 15862
## 81 15220
## 82 14928
par(bg = "ghostwhite", bty="n")
Aantal <- c(arbuthnot$Jaar)
plot(Aantal,ylim=c(4000,17000),xaxt="n",xlab="Jaren",col="white",las=1,main="Totaal aantal geborenen in Londen 1629 -1710.", col.main="black",font.main=2,adj=0) #Teken eerst een plot(box)
lines(x,lwd=3.5,col="darkorange")
axis(1, at = c(1,12,32,46,52,72,76,82),
labels = c("1629","1640","1660","1674","1680","1700","1704","1710"))
# teken de vertikale lijnen op de speciale jaarplekken.
abline(v=1,lty="dotted",col = "gray90")
abline(v=12,lty="dotted",col = "gray90")
abline(v=32,lty="dotted",col = "gray90")
abline(v=52,lty="dotted",col = "gray90")
abline(v=72,lty="dotted",col = "gray90")
abline(v=82,lty="dotted",col = "gray90")
abline(v=76,lty="dotted",col="gray90")
abline(v=46,lty="dotted",col="gray90")
mtext("Bron: John Arbuthnot (1710)", side=1,line=4, cex=0.8, col="gray90", adj=1)
text(22,12000,"1639 - 1651 Engelse Burgeroorlog",col="black")
text(46,8000,"1666 Grote Brand van Londen", col ="black")
text(42,8500,"1665 Pestepidemie", col="black")
text(8,8000,"1630 Pestepidemie", col="black")
text(10,7000,"1632 Pestepidemie", col="black")
text(60,7000,"In 1674 en 1704 Fouten in gegevens(gelijke waarden)", col="black")
# 1639 - 1651 Engelse Burgeroorlog.
1666 Grote Brand van Londen. 1665 Pestepidemie 1630 en 1632 Pestepidemie
# Teken een lijngrafiek-------------------------------------------------------------------------------
library(readr)
arbuthnot <- read_delim("GeboortenLonden1629-1710.csv",
";", escape_double = FALSE, col_types = cols(X1 = col_skip()),
trim_ws = TRUE)
## Warning: Missing column names filled in: 'X1' [1]
par(bg = "ghostwhite", bty="n")
Aantal <- c(arbuthnot$Jaar)
plot(Aantal,ylim=c(2500,8500),xaxt="n",xlab="Jaren",las=1) #Teken eerst een plot(box)
#dan de lijnen
lines(arbuthnot$Meisjes,lwd=3.5,col="darkorange")
lines(arbuthnot$Jongens,lwd=3.5,col="steelblue1")
# plaats streepjes en labels op de xas. axis(side, at=, labels=, pos=, lty=, col=, las=, tck=, ...)
# side =1=bottom, 2=left, 3=top, 4=right)
# dit werkt alleen als je de standaard x-as op "n"hebt gezet, zie boven xaxt="n"
axis(1, at = c(1,12,32,46,52,72,76,82),
labels = c("1629","1640","1660","1674","1680","1700","1704","1710"))
# teken de vertikale lijnen op de speciale jaarplekken.
abline(v=1,lty="dotted",col = "black")
abline(v=12,lty="dotted",col = "black")
abline(v=32,lty="dotted",col = "black")
abline(v=52,lty="dotted",col = "black")
abline(v=72,lty="dotted",col = "black")
abline(v=82,lty="dotted",col = "black")
abline(v=76,lty="dotted",col="darkorange")
abline(v=46,lty="dotted",col="darkorange")
# Maakt een titel, blauw, bold font, links uitgelijnd op de y-as
title(main="In Londen geboren jongens en meisjes 1629 - 1710 (gegevens van doopfeesten gebruikt).", col.main="black",font.main=2,adj=0)
legend(52,4000, # plaatst een legenda op de juiste plaats.
c("Jongens","Meisjes"), # plaatst tekst in de legenda, volgorde op basis van uiteinden van de lijnen!
lty=c(1,1), # geeft de legenda de juiste symbolen of lijnen.
lwd=c(3.5,3.5),col=c("steelblue1","darkorange"), # gives the legend lines the correct color and width
bty="n")
#plaats tekst linksonder op 4 lijnen beneden de yas, met grootte 0.8 een maak blauw.
mtext("Bron: John Arbuthnot (1710)", side=1,line=4, cex=0.8, col="gray90", adj=1)
# scatterplot
par(mfrow=c(1, 2),bg="ghostwhite")
plot(x = arbuthnot$Jaar, y = arbuthnot$Meisjes,xlim=c(1629,1710),col="blue",pch=21,bg="darkorange", cex=2, main="Geboren meisjes 1629 - 1710 in totaal 453841", col.main="darkorange", adj=0, las=1)
plot(x = arbuthnot$Jaar, y = arbuthnot$Jongens,xlim=c(1629,1710),col="blue",pch=21,bg="steelblue1", cex=2, main="Geboren jongens 1629 - 1710 in totaal 484382", col.main="steelblue1", adj=0, las=1)
mtext("Bron: John Arbuthnot (1710)", side=1,line=3, cex=0.8, col="blue", adj=1)