library(nameGenerator)
library(dplyr)
##
## Attaching package: 'dplyr'
##
## The following object is masked from 'package:stats':
##
## filter
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(knitr)
eras <- expand.grid(Year = c(1880, 1910, 1950, 1990,2010),
Sex = c("M","F"))
eras %>%
group_by(Year, Sex)%>%
mutate(name = most_prob_name(Year = Year, Sex = Sex))
## Source: local data frame [10 x 3]
## Groups: Year, Sex
##
## Year Sex name
## 1 1880 M Joharlil:
## 2 1910 M Johart.
## 3 1950 M Jon.
## 4 1990 M Jon.
## 5 2010 M Jan.
## 6 1880 F Ma.
## 7 1910 F Ma.
## 8 1950 F Ma.
## 9 1990 F A.
## 10 2010 F A.
eras %>%
group_by(Year, Sex)%>%
mutate(name = most_prob_name2(Year = Year, Sex = Sex))
## Source: local data frame [10 x 3]
## Groups: Year, Sex
##
## Year Sex name
## 1 1880 M John.
## 2 1910 M John.
## 3 1950 M John.
## 4 1990 M Joshua.
## 5 2010 M Jacolan.
## 6 1880 F Mary.
## 7 1910 F Mary.
## 8 1950 F Mary.
## 9 1990 F Ale.
## 10 2010 F Alia.
Silliness
generate_n_names(30, Year = 2010, Sex = "M")
## Warning: Unequal factor levels: coercing to character
## [1] "Ay." "Cken" "Sisagi" "Ph" "Riaew" "Ahavi" "The."
## [8] "Eli." "Ilas." "Sckis" "Efieri" "Le." "Janca" "D."
## [15] "Anyl." "Vyli" "Jorl." "Gan." "Guerase" "Ph." "Jorer"
## [22] "Asolont" "Geo." "Gravas" "Nnthu" "Miasor" "Joxtide" "Man."
## [29] "M." "Mesen"
generate_n_names(30, Year = 2010, Sex = "F")
## Warning: Unequal factor levels: coercing to character
## [1] "A." "Khrind" "Ve." "Morie." "Rurylie" "Mah." "E."
## [8] "Ka." "Eory" "E." "Asiali" "Gron." "Llilynn" "E."
## [15] "Cee." "Li." "Hon." "Ayevia" "Memae." "Klad." "Elanay"
## [22] "Acadi" "Aynin" "Ay." "Asiyah" "Incyle" "Ka." "Emelils"
## [29] "Belyl" "Walite"
generate_n_names(30, Year = 1910, Sex = "M")
## Warning: Unequal factor levels: coercing to character
## [1] "Wamialle" "Hue." "Jo." "Jameo" "D." "Jond."
## [7] "A." "Rs." "Janes" "Jart" "Ld." "Gell"
## [13] "Clas." "Wia" "Rgesth" "Es." "El." "Wieus."
## [19] "Sher" "R." "Jandoy" "Ckies" "Winde" "Rar."
## [25] "Ged" "Rrmug" "Rd." "D." "Nrlte" "Chadr"
generate_n_names(30, Year = 1910, Sex = "F")
## Warning: Unequal factor levels: coercing to character
## [1] "H." "Magion" "Lly." "Ma." "Se." "Laclel" "Iness."
## [8] "Mitil" "Eosay." "Ma." "Ba." "E." "H." "Gida."
## [15] "H." "A." "Ldazea" "A." "Ceta." "Maubeor" "Pan."
## [22] "Sa." "Hyry" "Ca." "Ratlar" "Clile" "Ph." "La."
## [29] "A." "Miclin"
generate_n_names2(30, Year = 2010, Sex = "M")
## Warning: Unequal factor levels: coercing to character
## [1] "Azac." "Isan." "Jesseb."
## [4] "Sueliain." "Braydeant." "Roy."
## [7] "Kae." "Min." "Akendo."
## [10] "Natharlexandradden." "Chas." "Evionnordarlor."
## [13] "Eren." "Aden." "Noah."
## [16] "Braydes." "Sin." "Noah."
## [19] "Dangel." "Con." "Chew."
## [22] "Ke." "Se." "Den."
## [25] "Ph." "Cob." "Mandrestianno."
## [28] "Brale." "Dantophesaacon." "Austin."
generate_n_names2(30, Year = 2010, Sex = "F")
## Warning: Unequal factor levels: coercing to character
## [1] "Haricitla." "Jadandanna." "Marmon."
## [4] "Dan." "Ariangencellia." "Julia."
## [7] "Alee." "Na." "Addisa."
## [10] "Aile." "Lyn." "Cla."
## [13] "Maceccallina." "Guinevel." "Baise."
## [16] "Kene." "Ava." "Alia."
## [19] "Alyn." "Kaycie." "Mayla."
## [22] "Ka." "Jaya." "Bris."
## [25] "Eslyn." "Kimary." "Dakalilia."
## [28] "Shaynna." "Embelly." "Madeva."
generate_n_names2(30, Year = 1910, Sex = "M")
## Warning: Unequal factor levels: coercing to character
## [1] "Nion." "Jamesseph." "Rold."
## [4] "Rober." "Williames." "Hank."
## [7] "Hard." "Ald." "Heonallawremmick."
## [10] "Willeorgeor." "Lard." "Nie."
## [13] "Frank." "Edmueltomaspetthomar" "Floydneterichand."
## [16] "Cy." "Oseph." "Gilliames."
## [19] "Her." "Clauliam." "Owaltony."
## [22] "Rance." "Guan." "Germaxwes."
## [25] "Gert." "Jes." "Mes."
## [28] "Adde." "Cliam." "Robence."
generate_n_names2(30, Year = 1910, Sex = "F")
## Warning: Unequal factor levels: coercing to character
## [1] "Lucililice." "Anorothy." "Viola."
## [4] "Sopaura." "Sophina." "Alineannice."
## [7] "Lie." "Lucy." "Leoncha."
## [10] "Mae." "Liane." "Lie."
## [13] "Anna." "Gla." "Sarl."
## [16] "Emmamillizaberna." "Clah." "Gerthertruthy."
## [19] "Na." "Dolouisephnnaommamin" "Irgine."
## [22] "Alda." "Mabeste." "Herthy."
## [25] "Floise." "Ida." "Anne."
## [28] "Lenie." "Emmaura." "Rutheleon."