update unisex names code and data
This commit is contained in:
@@ -4,7 +4,7 @@ We hope you'll use it to check our work and to create stories and visualizations
|
||||
|
||||
Article Date(s) | Headline(s) | Folder
|
||||
---|---------|-------------
|
||||
June 10, 2015 | [There Are 922 Unisex Names In America — Is Yours One Of Them?](http://fivethirtyeight.com/features/there-are-922-unisex-names-in-america-is-yours-one-of-them) | `unisex-names`
|
||||
June 10, 2015 | [The Most Common Unisex Names In America: Is Yours One Of Them?](http://fivethirtyeight.com/features/there-are-922-unisex-names-in-america-is-yours-one-of-them) | `unisex-names`
|
||||
June 9, 2015 | [Blatter’s Reign At FIFA Hasn’t Helped Soccer’s Poor](http://fivethirtyeight.com/features/blatters-reign-at-fifa-hasnt-helped-soccers-poor/) | `elo-blatter`
|
||||
June 5, 2015 | [Why Some Tennis Matches Take Forever](http://fivethirtyeight.com/features/why-some-tennis-matches-take-forever/) | `tennis-time`
|
||||
June 3, 2015 | [Where Police Have Killed Americans In 2015](http://fivethirtyeight.com/features/where-police-have-killed-americans-in-2015) | `police-killings`
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
### Unisex Names
|
||||
|
||||
This directory contains the code and data behind the story [There Are 922 Unisex Names In America — Is Yours One Of Them?](http://fivethirtyeight.com/features/there-are-922-unisex-names-in-america-is-yours-one-of-them)
|
||||
This directory contains the code and data behind the story [The Most Common Unisex Names In America: Is Yours One Of Them?](http://fivethirtyeight.com/features/there-are-922-unisex-names-in-america-is-yours-one-of-them)
|
||||
|
||||
The script `unisex_names.R` generates the data in `unisex_names_table.csv`, which contains the 924 names given to each sex at least one-third of the time and with a minimum of 100 people. It has the following variables:
|
||||
The script `unisex_names.R` generates the data in `unisex_names_table.csv`, which contains the over 900 names given to each sex at least one-third of the time and with a minimum of 100 people. It has the following variables:
|
||||
|
||||
Header | Definition
|
||||
---|---------
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# June 10, 2015
|
||||
# Andrew <andrew.flowers@fivethirtyeight.com>
|
||||
|
||||
setwd("~/private-data/unisex-names") # Change for your machine
|
||||
setwd("~/data/unisex-names") # Change for your machine
|
||||
|
||||
require(dplyr)
|
||||
require(babynames)
|
||||
@@ -65,11 +65,6 @@ unisexSummary_top20 <- unisexSummary %>% filter(total>=25000)
|
||||
|
||||
# For sortable table
|
||||
unisexSummary_table <- unisexSummary %>% select(name, total, male_share, female_share, gap)
|
||||
|
||||
# Filter out odd names
|
||||
unisexSummary_table <- unisexSummary_table %>%
|
||||
filter(name != "Unnamed" & name != "Unknown")
|
||||
|
||||
write.csv(unisexSummary_table, "unisex_names_table.csv")
|
||||
|
||||
# For specific queries
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user