Between the years 1961 and 1972 American space agency NASA launched the Apollo missions. The Apollo Missions were 17 missions launched in succession by NASA exploring outer space and space launches, even ultimately landing humans on the moon in 1968. With the Apollo Missions, American interest in science and space skyrocketed. It is my belief that the Apollo Missions, and interest in space caused Americans between 1961 and 1972 to name more children after celestial bodies. In my first pair of graphs i cross referenced the BabyNames database with names of all of the natural satellites in the solar system:
I had to do a webscrape from Wikipedia to take all of the names of the moons in the Solar System, once the webscrape was taken I used the “.[6]” code to pull in the 6th table from Wikipedia which was the table of each of the moons categorized.
##
## The downloaded binary packages are in
## /var/folders/57/m_92_xjx69v_7h2w5qzd_kpr0000gn/T//Rtmpf0XhuS/downloaded_packages
## Loading required package: xml2
After the webscrape I cross refrenced the Moons database from Wikipeda with the Baby names database to test my Hypthosis. I decided to start with 10 years prior to the Apollo Missions to 10 years post missions to notice the trends of the names before during and after the missions.
as.data.frame(wiki_tbls) -> wiki1
moons <- wiki1
install.packages("babynames", repos = "http://cran.us.r-project.org")
##
## The downloaded binary packages are in
## /var/folders/57/m_92_xjx69v_7h2w5qzd_kpr0000gn/T//Rtmpf0XhuS/downloaded_packages
library(babynames)
library(tidyverse)
## ── Attaching packages ──────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.2.1 ✓ purrr 0.3.3
## ✓ tibble 2.1.3 ✓ dplyr 0.8.4
## ✓ tidyr 1.0.2 ✓ stringr 1.4.0
## ✓ readr 1.3.1 ✓ forcats 0.4.0
## ── Conflicts ─────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x readr::guess_encoding() masks rvest::guess_encoding()
## x dplyr::lag() masks stats::lag()
## x purrr::pluck() masks rvest::pluck()
view(moons)
intersect(moons$Name, babynames$name) -> intersection
intersection
## [1] "Moon" "Deimos" "Io" "Callisto" "Amalthea"
## [6] "Elara" "Leda" "Kale" "Kore" "Dia"
## [11] "Eirene" "Ersa" "Dione" "Rhea" "Titan"
## [16] "Phoebe" "Janus" "Helene" "Calypso" "Atlas"
## [21] "Prometheus" "Pandora" "Fenrir" "Kari" "Ariel"
## [26] "Titania" "Oberon" "Miranda" "Cordelia" "Ophelia"
## [31] "Bianca" "Cressida" "Desdemona" "Juliet" "Portia"
## [36] "Rosalind" "Belinda" "Prospero" "Stephano" "Francisco"
## [41] "Margaret" "Ferdinand" "Perdita" "Cupid" "Triton"
## [46] "Thalassa" "Despina" "Galatea" "Larissa" "Sao"
## [51] "Charon" "Nix"
View(intersection)
babynames %>%
filter(name %in% intersection) -> moonBabyNames
moonBabyNames %>%
count(name) %>%
arrange(desc(n)) %>%
head(20) -> mostCommon
View(mostCommon)
After creating an intersection between the database I created and the babynames database and filtering out the top 20 names(Two graphs, one for Male names & one for Female names), I was then ready to visualize my data and test my hypthosis!
# ggplot(aes())
#These years only for women Visualized
#REMEMBER TO USE THIS GRAPH
babynames %>%
filter(name %in% mostCommon$name & year > 1951 & year < 1985 & sex == "F") %>%
ggplot(aes(year, prop, color = name)) + geom_line() -> moongraph1
moongraph1
babynames %>%
filter(name %in% mostCommon$name & year > 1951 & year < 1985 & sex == "M") %>%
ggplot(aes(year, prop, color = name)) + geom_line() -> moongraph2
moongraph2
After visualizing the data I’ve come to find that my hyphothsis was wrong. I thought there would be an up trend in names after celestial bodies(particularily moons) but this turned out not to be the case(aside from the name Francisco). In fact, moon names declined during and after the Apollo Missions. Of course other factors are at play such as name trends and the age of some of these names, but as popular as the Apollo Missions were I thought it would at least bump the popularity of the top 20 names.
library(rvest)
library(babynames)
library(tidyverse)
Here is my code for Visualizing each of the graphs(one for Male names & one for Female names)
babynames %>%
filter(name %in% mostCommon$name & year > 1951 & year < 1985 & sex == "F") %>%
ggplot(aes(year, prop, color = name)) + geom_line() -> moongraph1
babynames %>%
filter(name %in% mostCommon$name & year > 1951 & year < 1985 & sex == "M") %>%
ggplot(aes(year, prop, color = name)) + geom_line()