# comparison of Prem vs conmat for germany:
library(deSolve)
library(tidyverse)
library(conmat)
world_data <- socialmixr::wpp_age() %>%
mutate(
new_lower_age = if_else(lower.age.limit >= 75, 75L, lower.age.limit)
) %>%
View conmat-v-prem.md
View distributions.md
library(distributional)
library(tidyverse)
dat <- tibble(
id = 1:10,
mean = c(1:10),
sd = c(1:10)
) %>%
mutate(dist = dist_normal(
View exploring-updated-wpp-data.md
library(tidyverse)
library(ggforce)
wpp_020 <- readr::read_csv("https://gist.githubusercontent.com/njtierney/8b3b55cec0fe95f496b7047bf095fd5b/raw/5b31740a102198fa3f76105f5f994bfa16e3e7f5/wpp_020.csv")
#> Rows: 70854 Columns: 4
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (1): country
#> dbl (3): lower.age.limit, year, population
#>
View wpp_018.csv
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
country,lower.age.limit,year,population | |
Afghanistan,0,1950,1291621.9999999998 | |
Afghanistan,0,1955,1353989 | |
Afghanistan,0,1960,1538039 | |
Afghanistan,0,1965,1759739 | |
Afghanistan,0,1970,2022533 | |
Afghanistan,0,1975,2323223 | |
Afghanistan,0,1980,2475420 | |
Afghanistan,0,1985,2246768 | |
Afghanistan,0,1990,2339899 |
View wpp_020.csv
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
country,lower.age.limit,year,population | |
AFRICA,0,1950,38705049 | |
AFRICA,0,1955,44304214 | |
AFRICA,0,1960,50491493 | |
AFRICA,0,1965,57690110 | |
AFRICA,0,1970,65452837 | |
AFRICA,0,1975,75017430 | |
AFRICA,0,1980,86666665.00000001 | |
AFRICA,0,1985,98999023 | |
AFRICA,0,1990,110362756 |
View corplot-facets.md
library(tidyverse)
library(visdat)
iris_tbl <- as_tibble(iris)
iris_tbl_nest <- iris_tbl %>%
group_nest(Species) %>%
mutate(
vis_cor = map2(.x = data, .y = Species, function(.x, .y){
View deck-shuffle.md
# simulated probability of getting the same cards twice in a shuffled deck
hand <- as.integer(c(7,10,2,3,1))
deck <- 1:52
deck_draws <- replicate(
n = 1e7,
expr = {
View scales-is-awesome.md
library(scales)
percent(0.1)
#> [1] "10%"
percent(0.01)
#> [1] "1%"
percent(0.001)
#> [1] "0%"
percent(1)
#> [1] "100%"
View missing-data-things.md
library(palmerpenguins)
penguins[1:5, c(3)] <- -99
penguins[1:5, c(4)] <- -98
penguins
#> # A tibble: 344 × 8
#> species island bill_length_mm bill_depth_mm flipper_…¹ body_…² sex year
#> <fct> <fct> <dbl> <dbl> <int> <int> <fct> <int>
NewerOlder