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
library(tidyverse) | |
library(future) | |
library(furrr) | |
library(gapminder) | |
# ------ create dummy dataset | |
df <- gapminder::gapminder | |
table(df$year) |
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
library(tidyverse) | |
library(future) | |
library(furrr) | |
library(gapminder) | |
library(svMisc) | |
# ------ create dummy dataset | |
df <- gapminder::gapminder | |
table(df$year) |
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
library(tidyverse) | |
df <- tibble(cpr = c(1, 1, 1, 1, 2, 2, 2), | |
alder_flyt = c(7, 9, 33, 33, 7, 11, 19), | |
kommune = c(100, 100, 99, 100, 50, 50, 50)) | |
df | |
# max_age <- max(df$alder_flyt, na.rm = TRUE) | |
# min_age <- min(df$alder_flyt, na.rm = TRUE) |
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
library(lubridate) | |
# create fake CPR | |
cpr <- "181292-1731" | |
# get DOB | |
bdate <- stringr::str_sub(cpr, 1, 6) | |
# convert to date | |
bdate <- lubridate::dmy(bdate) |
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
df <- tibble(date = c("06-10-2021", "07-10-2021"), | |
y = c(1, 2)) | |
df %<>% | |
mutate(date = lubridate::dmy(date)) | |
df %>% | |
ggplot(., aes(x = date, y = y)) + | |
geom_point() |
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
orange <- c("a", "c", "d") | |
df <- tibble(a = round(rnorm(mean = .5, sd = .1, n = 10), 0), | |
b = round(rnorm(mean = .5, sd = .1, n = 10), 0), | |
c = round(rnorm(mean = .5, sd = .1, n = 10), 0), | |
d = round(rnorm(mean = .5, sd = .1, n = 10), 0), | |
e = round(rnorm(mean = .5, sd = .1, n = 10), 0)) | |
df %>% |
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
library(tidyverse) | |
library(sf) | |
library(tmap) | |
tmap_mode("view") | |
url <- "https://api.dataforsyningen.dk/afstemningsomraader?format=geojson" | |
ao <- read_sf(url) |
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
library(fixest) | |
library(broom) | |
library(tidyverse) | |
library(janitor) | |
options(scipen = 999) | |
df <- gapminder::gapminder | |
mlist <- list() |
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
library(tidyverse) | |
library(sf) | |
demo(nc, ask = FALSE, verbose = FALSE) | |
nc <- nc %>% | |
mutate(polygon_id = row_number()) | |
ggplot() + |
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
rm(list = ls()) | |
library(tidyverse) | |
library(lubridate) | |
players <- read_csv("https://raw.githubusercontent.com/JeffSackmann/tennis_atp/master/atp_players.csv") | |
decades <- c("70", "80", "90", "00", "10", "20") |
OlderNewer