-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding english-monarchs-and-marriages (enmoma) dataset (#721)
* creating the english-monarchs-and-marriages branch, aka enmoma for short. testing the pull request method with tidytuesday team on this old issue * update scripts and data * data descriptions * Update data/curated/enmoma/meta.yaml Co-authored-by: Jon Harmon <[email protected]> * Credit * Accept submission * Update data/2024/2024-08-20/readme.md --------- Co-authored-by: Jon Harmon <[email protected]> Co-authored-by: jonthegeek <[email protected]>
- Loading branch information
1 parent
98b36f2
commit 6c4903e
Showing
7 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
king_name,king_age,consort_name,consort_age,year_of_marriage | ||
Æthelwulf,?,Osburh,?,851(?) | ||
Æthelwulf,50(?),Judith of Flanders,12,856 | ||
Æthelbald,24,Judith of Flanders,14,858 | ||
Æthelberht,–,–,–,– | ||
Æthelred,?,Wulfthryth?,?,? | ||
Alfred the Great,19,Ealhswith,16,868 | ||
Edward the Elder,19,Ecgwynn,?,893 | ||
Edward the Elder,28,Aelffaed,?,902 | ||
Edward the Elder,31,Eadgifu of Kent,?,905 | ||
Æthelstan,–,–,–,– | ||
"Edmund | ||
the Magnificent",,Ælfgifu of Shaftesbury,–,– | ||
"Edmund | ||
the Magnificent",22,Æthelflæd of Damerham,?,944 | ||
Eadred,–,–,–,– | ||
Eadwig,,Ælfgifu,?,955(?) | ||
Edgar the Peaceful,17,Æthelflæd,?,960 | ||
Edgar the Peaceful,21,Ælfthryth,19,964 | ||
Edward the Martyr,–,–,–,– | ||
Æthelred the Unready,23,Ælfgifu of York,21,991 | ||
Æthelred the Unready,34,Emma of Normandy,17,1002 | ||
"Sweyn | ||
Forkbeard",,Gunhild of Wenden,?,990 | ||
"Sweyn | ||
Forkbeard",,Sigrid the Haughty,?,1000 | ||
"Edmund | ||
Ironside",,Edith of East Anglia,?,? | ||
Cnut,18,Aelfgifu of Northampton,?,1013(?) | ||
Cnut,22,Emma of Normandy,?,1017 | ||
"Harold | ||
Harefoot",,Ælfgifu,?,? | ||
Harthacnut,–,–,–,– | ||
Edward the Confessor,42,Edith of Wessex,20,1045 | ||
Harold Godwinson,24,Edith Swannesha,19,1044(?) | ||
Harold Godwinson,42,Ealdgyth,?,1064 | ||
William I,25,Matilda of Flanders,22,1053 | ||
William II,–,–,–,– | ||
Henry I,32,Matilda of Scotland,20,1100 | ||
Henry I,53,Adeliza of Louvain,18,1121 | ||
Stephen,29,Matilda of Boulogne,20,1125 | ||
Henry II,19,Eleanor of Aquitaine,30,1152 | ||
Henry the Young King,5,Margaret of France,3,1160 | ||
Richard I,34,Berengaria of Navarre,26,1191 | ||
John,23,Isabel of Gloucester,16,1189 | ||
John,34,Isabella of Angoulême,12,1200 | ||
Henry III,29,Eleanor of Provence,13,1236 | ||
Edward I,15,Eleanor of Castile,13,1254 | ||
Edward I,60,Margaret of France,20,1299 | ||
Edward II,24,Isabella of France,13,1308 | ||
Edward III,16,Philippa of Hainault,14,1328 | ||
Richard II,15,Anne of Bohemia,16,1382 | ||
Richard II,29,Isabella of Valois,7,1396 | ||
Henry IV,14,Mary de Bohun,12,1380 | ||
Henry IV,37,Joanna of Navarre,33,1403 | ||
Henry V,34,Catherine of Valois,19,1420 | ||
Henry VI,24,Margaret of Anjou,15,1445 | ||
Edward IV,22,Elizabeth Woodville,27,1464 | ||
Edward V,–,–,–,– | ||
Richard III,20,Anne Neville,16,1472 | ||
Henry VII,29,Elizabeth of York,20,1486 | ||
Henry VIII,18,Catherine of Aragon,24,1509 | ||
Henry VIII,42,Anne Boleyn,32,1533 | ||
Henry VIII,45,Jane Seymour,28,1536 | ||
Henry VIII,49,Anne of Cleves,25,1540 | ||
Henry VIII,49,Catherine Howard,19,1540 | ||
Henry VIII,52,Catherine Parr,31,1543 | ||
Edward VI,–,–,–,– | ||
Mary I,38,Philip II of Spain,27,1554 | ||
Elizabeth I,–,–,–,– | ||
James I,23,Anne of Denmark,15,1589 | ||
Charles I,25,Henrietta Maria of France,16,1625 | ||
Charles II,32,Catherine of Braganza,24,1662 | ||
James II,27,Anne Hyde,22,1660 | ||
James II,40,Mary of Modena,15,1673 | ||
Mary II,15,William III,27,1677 | ||
William III,27,Mary II,15,1677 | ||
Anne,18,George of Denmark,30,1683 | ||
George I,22,Sophia Dorothea of Brunswick-Lueneburg-Celle,16,1682 | ||
George II,22,Caroline of Ansbach,22,1705 | ||
George III,23,Charlotte of Mecklenburg-Strelitz,17,1761 | ||
George IV,23,Maria Anne Fitzherbert,29,1785 | ||
George IV,33,Caroline of Brunswick,27,1795 | ||
William IV,53,Adelaide of Saxe-Meiningen,26,1818 | ||
Victoria,21,Albert of Saxe-Coburg and Gotha,21,1840 | ||
Edward VII,22,Alexandra of Denmark,19,1863 | ||
George V,28,Mary of Teck,26,1893 | ||
Edward VIII,43,Wallis Warfield Simpson,41,1937 | ||
George VI,28,Elizabeth Bowes-Lyon,23,1923 | ||
Elizabeth II,21,Philip of Greece and Denmark,26,1947 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
title: English Monarchs and Marriages | ||
article: | ||
title: monarchs and marriages | ||
url: github.com/frankiethull/english_monarch_marriages | ||
data_source: | ||
title: A list of Monarchs by marriage | ||
url: https://www.ianvisits.co.uk/articles/a-list-of-monarchs-by-marriage-6857/ | ||
images: | ||
# Please include at least one image, and up to three images | ||
- file: gg_enmoma.png | ||
alt: Chart showing the relationship between the year of marriage and the age of king/consort. The x-axis lists the years and the y-axis represents the age range. The chart indicates that the average age of marriage for a consort being much lower than king's age |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# English Monarchs and Marriages | ||
|
||
This week we are exploring [English Monarchs and Marriages](https://github.com/frankiethull/english_monarch_marriages)! | ||
|
||
> this dataset focuses on the names, ages, and marriages of various 'kings' and 'consorts'. the data ranges all the way back to 850 where the details are a bit fuzzy, spanning all the way to current day. names contain special characters; ages & years can be a bit of a regex puzzle as well. additionally, the age of kings and consorts may show quite a bit of an age gap. | ||
The data was scraped from [Ian Visits](https://www.ianvisits.co.uk/articles/a-list-of-monarchs-by-marriage-6857/) by [f. hull](https://github.com/frankiethull), who also curated this week's post! | ||
|
||
## The Data | ||
|
||
```r | ||
# Option 1: tidytuesdayR package | ||
## install.packages("tidytuesdayR") | ||
|
||
tuesdata <- tidytuesdayR::tt_load('2024-08-20') | ||
## OR | ||
tuesdata <- tidytuesdayR::tt_load(2024, week = 34) | ||
|
||
english_monarchs_marriages_df <- tuesdata$english_monarchs_marriages_df | ||
|
||
# Option 2: Read directly from GitHub | ||
|
||
english_monarchs_marriages_df <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-08-20/english_monarchs_marriages_df.csv') | ||
``` | ||
|
||
## How to Participate | ||
|
||
- [Explore the data](https://r4ds.hadley.nz/), watching out for interesting relationships. We would like to emphasize that you should not draw conclusions about **causation** in the data. There are various moderating variables that affect all data, many of which might not have been captured in these datasets. As such, our suggestion is to use the data provided to practice your data tidying and plotting techniques, and to consider for yourself what nuances might underlie these relationships. | ||
- Create a visualization, a model, a [shiny app](https://shiny.posit.co/), or some other piece of data-science-related output, using R or another programming language. | ||
- [Share your output and the code used to generate it](../../../sharing.md) on social media with the #TidyTuesday hashtag. | ||
|
||
### Data Dictionary | ||
|
||
# `english_monarchs_marriages_df.csv` | ||
|
||
|variable |class |description | | ||
|:----------------|:---------|:----------------| | ||
|king_name |character |male or female ruler | | ||
|king_age |character |ruler's age | | ||
|consort_name |character |consort chosen to marry king | | ||
|consort_age |character |age of consort | | ||
|year_of_marriage |character |historical year of marriage | | ||
|
||
### Cleaning Script | ||
|
||
```r | ||
library(rvest) | ||
|
||
# url to scrape: | ||
root <- "https://www.ianvisits.co.uk/articles/a-list-of-monarchs-by-marriage-6857/" | ||
|
||
# get table | ||
tables <- read_html(root) |> html_nodes("table") | ||
df <- tables[1] |> html_table() |> as.data.frame() | ||
|
||
df <- df[, -6] # remove spoiler | ||
df <- df[-c(1,2), ] # remove double-header effect | ||
|
||
cols <- c("king_name", "king_age", "consort_name", "consort_age", "year_of_marriage") | ||
colnames(df) <- cols | ||
|
||
english_monarchs_marriages_df <- df | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters