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
options( | |
ggplot2.discrete.colour = lapply(1:12, ggthemes::ptol_pal()), | |
ggplot2.discrete.fill = lapply(1:12, ggthemes::ptol_pal()), | |
ggplot2.ordinal.colour = \(x, ...) scale_color_viridis_d(option = "G", direction = -1, ...), | |
ggplot2.ordinal.fill = \(x, ...) scale_fill_viridis_d(option = "G", direction = -1, ...), | |
ggplot2.continuous.colour = \(x,...) scico::scale_color_scico(palette = "batlow", ...), | |
ggplot2.continuous.fill = \(x,...) scico::scale_fill_scico(palette = "batlow", ...) | |
) |
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(gt) | |
tibble( | |
value = 1:6, | |
name = c( | |
"one", "two", "three", | |
"four", "five", "six" | |
), | |
die = str_glue( |
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
# I don't understand why or how this | |
# plus what's in Makevars works, but it's | |
# the only way I can get rstan & brms installed\ | |
# see also: https://github.com/stan-dev/rstan/issues/1070#issuecomment-1570565599 | |
# renv::init(bare = TRUE) | |
Sys.setenv(MAKEFLAGS = "-j4") # four cores used | |
install.packages(c("Rcpp", "RcppEigen", "RcppParallel", "StanHeaders"), type = "source") | |
install.packages("rstan", type = "source") |
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
#!/bin/sh | |
x="Version: 1.0 | |
RestoreWorkspace: Default | |
SaveWorkspace: Default | |
AlwaysSaveHistory: Default | |
EnableCodeIndexing: Yes | |
UseSpacesForTab: Yes | |
NumSpacesForTab: 2 | |
Encoding: UTF-8 |
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
import pandas as pd | |
def align_chunks(X_df, Y_df, A_idx_list, B_idx_list, state, **kwargs): | |
""" | |
Given X_df and Y_df, return the dataframes (A_df and B_df) with the | |
smallest possible span of overlapping transcription chunks. | |
Function operates recursively. | |
""" |
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
--- | |
title: "R Notebook" | |
output: html_notebook | |
--- | |
Source: | |
https://edition.cnn.com/election/2016/results/exit-polls | |
```{r} |
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
--- | |
title: "Building up and evaluating models" | |
output: | |
html_notebook: | |
code_folding: none | |
css: ../custom.css | |
theme: flatly | |
toc: yes | |
toc_depth: 3 | |
toc_float: yes |
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
--- | |
title: "Building up and evaluating models" | |
output: | |
html_notebook: | |
code_folding: none | |
css: ../custom.css | |
theme: flatly | |
toc: yes | |
toc_depth: 3 | |
toc_float: yes |
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(tweenr) | |
library(gganimate) | |
library(ggplot2) | |
library(tidyverse) | |
#' define the 4 states | |
state1 <- data_frame(mean = 0, | |
sd = 1) | |
state2 <- data_frame(mean = 0, | |
sd = 3) |
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) | |
replicates <- (1:100000)%>% | |
map(~sample(faithful$waiting, replace = T))%>% | |
map(mean)%>% | |
simplify() | |
data_frame(replicates = replicates)%>% | |
ggplot(aes(replicates))+ | |
stat_density() |
NewerOlder