Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding english-monarchs-and-marriages (enmoma) dataset #721

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ If you are using TidyTuesday to teach data-related skills, [please let us know](
| 31 | `2024-07-30` | [Summer Movies](data/2024/2024-07-30/readme.md) | [IMDb non-commercial datasets](https://developer.imdb.com/non-commercial-datasets/) | [IMDb's 2023 Summer Movie Guide](https://www.imdb.com/list/ls569932833) |
| 32 | `2024-08-06` | [Olympic Medals](data/2024/2024-08-06/readme.md) | [Kaggle Olypmic history data](https://www.kaggle.com/heesoo37/120-years-of-olympic-history-athletes-and-results) | [Financial Times Tokyo Olypmics analysis](https://ig.ft.com/tokyo-olympics-alternative-medal-table/) |
| 33 | `2024-08-13` | [World's Fairs](data/2024/2024-08-13/readme.md) | [List of world expositions (Wikipedia)](https://en.wikipedia.org/wiki/List_of_world_expositions) | [World's fair (Wikipedia)](https://en.wikipedia.org/wiki/World%27s_fair) |
| 34 | `2024-08-20` | [English Monarchs and Marriages](data/2024/2024-08-20/readme.md) | [A list of Monarchs by marriage](https://www.ianvisits.co.uk/articles/a-list-of-monarchs-by-marriage-6857/) | [monarchs and marriages](github.com/frankiethull/english_monarch_marriages) |

***

Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: English Monarchs and Marriages | Names, Ages, and Historical Years
title: English Monarchs and Marriages
article:
title: monarchs and marriages
url: github.com/frankiethull/english_monarch_marriages
Expand Down
65 changes: 65 additions & 0 deletions data/2024/2024-08-20/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# English Monarchs and Marriages

jonthegeek marked this conversation as resolved.
Show resolved Hide resolved
# 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
```
1 change: 1 addition & 0 deletions data/2024/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ Archive of datasets and articles from the 2024 series of `#TidyTuesday` events.
| 31 | `2024-07-30` | [Summer Movies](2024-07-30/readme.md) | [IMDb non-commercial datasets](https://developer.imdb.com/non-commercial-datasets/) | [IMDb's 2023 Summer Movie Guide](https://www.imdb.com/list/ls569932833) |
| 32 | `2024-08-06` | [Olympic Medals](2024-08-06/readme.md) | [Kaggle Olypmic history data](https://www.kaggle.com/heesoo37/120-years-of-olympic-history-athletes-and-results) | [Financial Times Tokyo Olypmics analysis](https://ig.ft.com/tokyo-olympics-alternative-medal-table/) |
| 33 | `2024-08-13` | [World's Fairs](2024-08-13/readme.md) | [List of world expositions (Wikipedia)](https://en.wikipedia.org/wiki/List_of_world_expositions) | [World's fair (Wikipedia)](https://en.wikipedia.org/wiki/World%27s_fair) |
| 34 | `2024-08-20` | [English Monarchs and Marriages](2024-08-20/readme.md) | [A list of Monarchs by marriage](https://www.ianvisits.co.uk/articles/a-list-of-monarchs-by-marriage-6857/) | [monarchs and marriages](github.com/frankiethull/english_monarch_marriages) |
16 changes: 0 additions & 16 deletions data/curated/enmoma/cleaning.R

This file was deleted.

7 changes: 0 additions & 7 deletions data/curated/enmoma/english_monarchs_marriages_df.md

This file was deleted.

52 changes: 0 additions & 52 deletions data/curated/enmoma/instructions.md

This file was deleted.

7 changes: 0 additions & 7 deletions data/curated/enmoma/intro.md

This file was deleted.

5 changes: 0 additions & 5 deletions data/curated/enmoma/saving.R

This file was deleted.

1 change: 1 addition & 0 deletions static/tt_data_type.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Week,Date,year,data_files,data_type,delim
34,2024-08-20,2024,english_monarchs_marriages_df.csv,csv,","
33,2024-08-13,2024,worlds_fairs.csv,csv,","
32,2024-08-06,2024,olympics.csv,csv,","
31,2024-07-30,2024,summer_movie_genres.csv,csv,","
Expand Down