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
| CountryRegion | alpha2 | alpha3 | CountryRegionTariff | USReciprocalTariffs | |
|---|---|---|---|---|---|
| Afghanistan | AF | AFG | 0.49 | 0.1 | |
| Albania | AL | ALB | 0.1 | 0.1 | |
| Algeria | DZ | DZA | 0.59 | 0.3 | |
| Andorra | AD | AND | 0.1 | 0.1 | |
| Angola | AO | AGO | 0.63 | 0.32 | |
| Anguilla | AI | AIA | 0.1 | 0.1 | |
| Antigua and Barbuda | AG | ATG | 0.1 | 0.1 | |
| Argentina | AR | ARG | 0.1 | 0.1 | |
| Armenia | AM | ARM | 0.1 | 0.1 |
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
| meta: | |
| name: "Lund Univerisy brand" | |
| link: "https://www.medarbetarwebben.lu.se/grafiskprofil" | |
| color: | |
| palette: | |
| lu-blue: "#000080" | |
| lu-gold: "#9C6114" | |
| bg-pink: "#E9C4C7" | |
| bg-pink-50: "#E9C4C780" |
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(magrittr) | |
| logit <- function(u) log(u)-log(1-u) | |
| raise_to_pow <- function(fun, pname_pow=".pow"){ | |
| eval(parse(text=gsub(pattern=".pow", replacement=pname_pow, | |
| "function(u, .pow=1, ...) fun(u,...)^(.pow)"))) | |
| } | |
| powlogit <- logit %>% raise_to_pow(pname_pow="e") |
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(rstan) | |
| stanmodelcode <- " | |
| data { | |
| int<lower=0> N; | |
| int<lower=0> y[N]; | |
| } | |
| parameters { | |
| real<lower=0.00001> Theta; | |
| } | |
| model { |
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(minisvg) | |
| lightpurple <- "#c0c0f2" | |
| darkpurple <- "#9596ce" | |
| x <- 5 | |
| s <- x*10 | |
| a <- x*sqrt(2) | |
| chkrs_pat <- stag$pattern(width=2*s, height=2*s, id = 'chkrs_pattern', | |
| patternUnits = 'userSpaceOnUse', | |
| stag$rect(x=0, y=0, width =s, height = s, fill=lightpurple), | |
| stag$rect(x=s, y=0, width =s, height = s, fill=darkpurple), |
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(tidybayes) | |
| library(ggplot2) | |
| library(hrbrthemes) | |
| m <- 100 | |
| s <- 10 | |
| dist_df <- tibble::tibble(y=seq.int(0.01,0.99, by=0.05), | |
| arg1_mean=qlnorm(p=y,meanlog=log(m), sdlog=log(s)), | |
| arg2_sd=abs(0.5-y+0.1)*400+100) |
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
| is.unset<-function(x) | |
| x==as.list(alist(a=))[[1]] | |
| is.nameempty <- function(x){ | |
| nx <- names(x) | |
| if(is.null(nx)) | |
| return(rep(TRUE, length(x))) | |
| is.na(nx) | nx=="" | |
| } |
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
| --- | |
| title: 'Tables with references' | |
| author: dmi3kno | |
| date: '2018-01-25' | |
| abstract: | | |
| My goal was to prepare a minimum reproducible example. | |
| output: | |
| pdf_document: | |
| citation_package: natbib | |
| keep_md: yes |
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(magick) | |
| library(hocr) | |
| library(bunny) | |
| library(bbx) | |
| library(dplyr) | |
| img <- image_read("https://pbs.twimg.com/media/EXKzsiAWoAYH9Pv?format=png") | |
| img_bw <- img %>% | |
| image_threshold("white", threshold = "5%") %>% |
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
| # tips and ideas from | |
| # https://stackoverflow.com/questions/5546346/how-to-place-and-center-text-in-an-svg-rectangle | |
| library(minisvg) | |
| doc <- svg_doc(width = 600, height = 600) | |
| #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| # Centered text in circle | |
| #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
NewerOlder