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(baRcodeR) # using custom_create_PDF() | |
library(pdftools) # using pdf_convert() | |
library(gt) | |
library(gtExtras) # using gt_img_rows() | |
# create example list of numbers to translate to barcodes | |
samples <- tibble(nr = c("1000000001", "1000000002", "1000000003")) |
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
# load packages ----------------------------------------------------------- | |
library(here) | |
library(sf) | |
library(ggplot2) | |
# download and read map data ---------------------------------------------- | |
url_gadm <- "https://biogeo.ucdavis.edu/data/gadm3.6/shp/gadm36_CHE_shp.zip" | |
download.file(url = url_gadm, | |
destfile = here("gadm36_CHE_shp.zip")) |
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) | |
# define amount of trials for the Monte Carlo Simulation | |
trial_n <- 1e5 | |
order <- NULL | |
n_smaller <- NULL | |
# generate random order for each trial | |
for (trial in 1:trial_n) { | |
set.seed(181231 + trial) |
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) | |
# define dimensions | |
width <- 0.5 | |
height <- 16.5 | |
spike <- 2 | |
# create vectors for polygon | |
i <- rep(1:30, each = 6) | |
x_pol <- rep(0.5 * width * c(-1, 1, 1, 0, -1, -1), 30) |
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(googlesheets) | |
library(dplyr) | |
library(readr) | |
library(ggplot2) | |
library(gganimate) | |
# Sharing Link of Google Sheet | |
qpcr_data_url <- | |
"https://docs.google.com/spreadsheets/d/1iJSVC2JgcSm1fYTJmTBwpqBJKhfhXQpzdfN6ktCfib8/edit?usp=sharing" |