Skip to content

Instantly share code, notes, and snippets.

---
name: "Pumpkins and peanuts committee"
date: "03/01/2000"
time: "2 pm"
location: "baseball field"
invited:
- Sally
- Shroeder
- Pig-pen
- Marcie
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@baptiste
baptiste / hexaweb.R
Last active November 10, 2023 16:40
library(ggforce)
library(purrr)
library(tibble)
library(gganimate)
web_strand <- function(side = 1, bend = 0.5, angle = 0, start = c(0,0)){
pos <- cbind(x=c(0, 1, 2), y = bend*c(0, 2, 0))
post <- pos %*% matrix(c(cos(angle), -sin(angle), sin(angle), cos(angle)), ncol=2, byrow=TRUE)
xt <- post[,1] + start[1]
yt <- post[,2] + start[2]
\documentclass[a4paper,10pt]{article}
\usepackage[a4paper]{geometry}
\geometry{textwidth=16cm}
\usepackage{enumitem}
\setlist[description]{font=\scshape\bfseries\rmfamily, leftmargin=2cm,
style=multiline,itemsep=6pt,parsep=2pt}
\begin{document}
---
title: "Untitled"
format:
pdf:
latex-tinytex: false
keep-md: true
keep-tex: true
fontsize: "11"
---
title
Testing svg in mathjax

Run with:

pandoc -s --mathjax test-die.md -o test-die.html
library(ggplot2)
library(grid)
element_box_break <- function (fill=NULL, colour = NULL, linewidth = NULL, linetype = NULL, lineend = NULL,
color = NULL, arrow = NULL, inherit.blank = FALSE) {
if (!is.null(color))
colour <- color
if (is.null(arrow))
arrow <- FALSE
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Julia" section="Scientific"
version="0"
extensions="*.jl"
mimetype="text/x-juliascript"
author="Andreas Nordal ([email protected])"
license="public domain">
<highlighting>
library(ggplot2)
library(readr)
library(ggfittext)
d <- read_csv('PrevalenceAtLarge.csv')
d$value <- cut(d$PercentAtLarge, breaks = 5,
labels = c("doubling under 6 weeks",
"doubling in 2–6 weeks",
"stable",
"halving in 2–6 weeks",
library(ggplot2)
library(tagger)
d <- data.frame(x=rep(1:10, 5*4*2), y=rnorm(10*5*4*2), f1=gl(4,10*5*2,labels=letters[1:4]), f2=gl(5,10*4*2,labels = LETTERS[1:5]), f3=gl(2,10*4*5))
p <- ggplot(d, aes(x,y)) +
facet_wrap(f1~f2+f3)
data <- ggplot_build(p)
str(data$layout$layout)