Skip to content

Instantly share code, notes, and snippets.

@iandanforth
iandanforth / rlreproducibilitychecklist.md
Last active May 11, 2019 01:34
RL Reproducibility Checklist

A Checklist for Reproducibility in Reinforcement Learning

From a slide in a NeurIPS 2018 keynote by Joelle Pineau

For all algorithms presented, check if you include:

  • A clear description of the algorithm.
  • An analysis of the complexity (time, space, sample size) of the algorithm.
  • A link to downloadable source code, including all dependencies.
@z3tt
z3tt / data.R
Last active August 28, 2018 19:38
Raincloudplots - movement model versus number of infection
dat <- structure(list(Move = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
@benmarwick
benmarwick / giur-zones-with-ggplot2.R
Last active June 18, 2023 02:58
Geometric Index of Unifacial Retouch Zone visualisation with ggplot2
library(ggplot2)
# coords for vertices of polygons that make the zones
polydata <- rbind(
data.frame(x = c(0, 0.01, 0.99, 1),
y = c(0, 0.25, 0.25, 0),
group = "zone 1",
fill = "grey80", xc = .5, yc = 0.125),
data.frame(x = c(0, 0.025, 0.495, 0.495),
y = c(-0.01, -0.25, -0.25, -0.01),
@johnjosephhorton
johnjosephhorton / uc_salaries_by_dept_and_rank.R
Created May 31, 2018 21:16
UC salaries by rank & dept
library(XML)
library(ggplot2)
df <- readHTMLTable("http://projects.dailycal.org/paychecker/departments/")[[1]]
DeMoney <- function(x) as.numeric(gsub(",", "", gsub("\\$", "", as.character(x))))
money.columns <- c("All", "Professor", "Associate professor", "Assistant professor",
"Lecturer")
@Robinlovelace
Robinlovelace / plotly-gantt.R
Created March 16, 2018 10:56
Gantt chart created with vistime
# install.packages("vistime")
library(vistime)
library(tidyverse)
library(lubridate)
# ?vistime
# d = read_csv("potential-projects/ofo/gantt.csv")
d = read.csv(stringsAsFactors = FALSE,text = "event,start,duration,group
compile datasets,0,2,descriptive analysis
baseline data,1,2,descriptive analysis
@benmarwick
benmarwick / rotate-axis-labels-ggplot2.R
Last active March 30, 2024 08:00
I can never remember how to rotate the x-axis labels with ggplot2: theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5))
# Adapted from https://stackoverflow.com/a/7267364/1036500 by Andrie de Vries
# This is it: theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5))
library(ggplot2)
td <- expand.grid(
hjust=c(0, 0.5, 1),
vjust=c(0, 0.5, 1),
angle=c(0, 45, 90),
# function to do a dodged half-boxplot and jittered points next to each other
#
# data_in should be a data frame
# factor_col should be a bare column name (not a string)
# although it will work if that column is factor or a character type
# numeric_col is the y axis continuous variable
# offset is the width of the boxplots and jittered point cloud
#
# the basic approach is to draw a boxplot without the tails
# (e.g. only the interquartile range) and then use segments to add the
## GOAL:
## re-create a figure similar to Fig. 2 in Wilson et al. (2018),
## Nature 554: 183-188. Available from:
## https://www.nature.com/articles/nature25479#s1
##
## combines a boxplot (or violin) with the raw data, by splitting each
## category location in two (box on left, raw data on right)
## call required packages
## GOAL:
## re-create a figure similar to Fig. 2 in Wilson et al. (2018),
## Nature 554: 183-188. Available from:
## https://www.nature.com/articles/nature25479#s1
##
## combines a boxplot (or violin) with the raw data, by splitting each
## category location in two (box on left, raw data on right)
# initial set-up ----------------------------------------------------------
# function to do a dodged half-boxplot and jittered points next to each other
#
# data_in should be a data frame
# factor_col should be a bare column name (not a string)
# although it will work if that column is factor or a character type
# numeric_col is the y axis continuous variable
# offset is the width of the boxplots and jittered point cloud
#
# the basic approach is to draw a boxplot without the tails
# (e.g. only the interquartile range) and then use segments to add the