Valhalla rising!
devtools::install_github("Steensson/valhalla")
"Interesting capitalization", I said. "Yeah. I'm a big believer in random capitalization. The rules of capitalization are so unfair to words in the middle.", Margo said.
valhalla::margonize("Sebastian. The man with the most sexy beard on Amager!")
#> [1] "sEbAstIaN. tHe mAN wITH thE Most SEXY beaRd ON AmaGEr!"
An attempt to mimic the _n function in Stata.
df <- data.frame(
id = c("A", "A", "B", "B", "B", "C", "C"),
val = rnorm(7)
)
df
#> id val
#> 1 A -1.2735070
#> 2 A -1.2743356
#> 3 B -0.3596289
#> 4 B 0.1624390
#> 5 B -0.3034001
#> 6 C 1.2165815
#> 7 C 1.2604616
df <- valhalla::stata_n(df, "id")
df
#> id val n
#> 1 A -1.2735070 1
#> 2 A -1.2743356 2
#> 3 B -0.3596289 1
#> 4 B 0.1624390 2
#> 5 B -0.3034001 3
#> 6 C 1.2165815 1
#> 7 C 1.2604616 2
An attempt to mimic the _N function in Stata.
df <- data.frame(
id = c("A", "A", "B", "B", "B", "C", "C"),
val = rnorm(7)
)
df
#> id val
#> 1 A 0.28485862
#> 2 A 1.15501992
#> 3 B 0.46695938
#> 4 B -0.04832549
#> 5 B -0.30642562
#> 6 C 0.17133504
#> 7 C -1.00036520
df <- valhalla::stata_N(df, "id")
df
#> id val N
#> 1 A 0.28485862 2
#> 2 A 1.15501992 2
#> 3 B 0.46695938 3
#> 4 B -0.04832549 3
#> 5 B -0.30642562 3
#> 6 C 0.17133504 2
#> 7 C -1.00036520 2
Calls dst.dk with name parameters and returns a dataframe with counts.
fornavn <- "Sebastian"
efternavn <- "Steenssøn"
df <- valhalla::hvor_mange_hedder(fornavn, efternavn)
df
#> name sex 2016 2017 change
#> 1 Sebastian M 14357 14672 315
#> 2 Steenssøn M/F 1 1 0
#> 3 Sebastian Steenssøn <NA> NA NA NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.