This file contains hidden or 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
#=============================================================================== | |
# 2021-06-11 -- twitter | |
# UEFA European Cup predictions | |
# Ilya Kashnitsky, [email protected], @ikashnitsky | |
#=============================================================================== | |
library(tidyverse) | |
library(magrittr) | |
library(ggdark) | |
library(paletteer) |
This file contains hidden or 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
#=============================================================================== | |
# 2021-04-19 -- critique | |
# Re-analysis of Royal family members longevity | |
# https://theconversation.com/amp/long-live-the-monarchy-british-royals-tend-to-survive-a-full-three-decades-longer-than-their-subjects-158766 | |
# Ilya Kashnitsky, [email protected], @ikashnitsky | |
#=============================================================================== | |
library(tidyverse) | |
library(magrittr) | |
library(lubridate) |
This file contains hidden or 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
library(tidyverse) | |
mtcars %>% | |
group_by(cyl = cyl %>% as_factor) %>% | |
summarise(avg_mpg = mpg %>% mean) %>% | |
ggplot(aes(avg_mpg, cyl))+ | |
geom_col() |
This file contains hidden or 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
library(ggtern) | |
library(ggdark) | |
library(hrbrthemes) | |
# own options for ternary theme | |
own_tern_theme <- dark_theme_minimal(base_family = font_rc) + | |
theme( | |
legend.position = "none", | |
axis.title = element_blank(), | |
tern.axis.arrow.show = FALSE, |
This file contains hidden or 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
lp <- function(path) { | |
require(here) | |
require(magrittr) | |
require(glue) | |
wd <- here::here() | |
glue(paste0("{wd}/", path)) | |
} |
This file contains hidden or 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
#=============================================================================== | |
# 2021-02-23 -- local hmd UPD 2025-04-11 | |
# Function to read in a whole local HMD folder | |
# Ilya Kashnitsky, [email protected] | |
#=============================================================================== | |
# a function to read ONE file | |
fread_hmd <- function(x) x %>% | |
data.table::fread(skip = 2, na.strings = ".") %>% | |
mutate(Age = Age %>% str_remove("\\+") %>% as.integer()) %>% |
This file contains hidden or 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
#=============================================================================== | |
# 2021-02-16 -- review | |
# BMJ Open Japan prefectures R2 | |
# Ilya Kashnitsky, [email protected] | |
#=============================================================================== | |
library(tidyverse) | |
library(magrittr) | |
library(janitor) |
This file contains hidden or 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
#=============================================================================== | |
# 2021-01-07 -- twitter | |
# Visualize Publons country data | |
# https://publons.com/country | |
# Ilya Kashnitsky, [email protected] | |
#=============================================================================== | |
library(tidyverse) | |
library(magrittr) | |
library(sf) |
This file contains hidden or 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
#=============================================================================== | |
# 2020-11-19 -- pppr | |
# Testing figure from JAMA Psych 10.1001/jamapsychiatry.2020.3938 | |
# Use Poisson distribution; plot as facets with common scale | |
# Ilya Kashnitsky, [email protected] | |
#=============================================================================== | |
library(tidyverse) | |
library(hrbrthemes) | |
library(ggeasy) |
This file contains hidden or 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
#=============================================================================== | |
# 2020-11-18 -- JAMA Psych pppr | |
# Testing figure from 10.1001/jamapsychiatry.2020.3938 | |
# Additional check on the order of data manipulations | |
# Ilya Kashnitsky, [email protected] | |
#=============================================================================== | |
library(tidyverse) | |
library(hrbrthemes) | |
library(ggeasy) |