Skip to content

Instantly share code, notes, and snippets.

View charliejhadley's full-sized avatar
🙋‍♀️
All tech is political

Charlie Joey Hadley charliejhadley

🙋‍♀️
All tech is political
View GitHub Profile
Percentile 18 to 21 22 to 29 30 to 39 40 to 49 50 to 59 60+
10 7832 13298 15774 15959 15440 14498
20 10015 15564 19224 19638 18685 17408
25 10746 16566 20879 21385 20199 18635
30 11440 17511 22449 23062 21828 19907
40 12813 19429 25683 26682 25064 22462
50 14923 24000 32568 34895 33179 28749
60 16275 26734 36653 39968 38141 33500
70 17131 28371 39000 42932 41097 36008
80 18130 30098 42000 46910 44904 39591
Type.of.policy Name.Policy Valid.from..b. Valid.until..c...
1 Leave policy Maternity leave 1994-06-10 1994-10-18
2 Leave policy Maternity leave 1994-10-19 1999-12-14
3 Leave policy Maternity leave 1999-12-15 2002-11-23
4 Leave policy Maternity leave 2002-11-24 2006-09-30
5 Leave policy Maternity leave 2006-10-01 2016-08-03
6 Leave policy Maternity leave 2014-12-01 2016-08-03
7 Leave policy Parental leave 1999-12-15 2002-01-09
8 Leave policy Parental leave 2002-01-10 2013-03-07
9 Leave policy Parental leave 2013-03-08 2015-04-04
@charliejhadley
charliejhadley / Plotly-server-test.Rmd
Last active August 3, 2016 15:59
Weird Plotly when deployed to Shiny
---
title: "Foo"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown

Keybase proof

I hereby claim:

  • I am martinjhnhadley on github.
  • I am martinjhnhadley (https://keybase.io/martinjhnhadley) on keybase.
  • I have a public key whose fingerprint is A8A5 C189 78A6 87EF DE35 CDDB F2BD 7938 857E 429D

To claim this, I am signing this object:

# install.packages()
library(leaflet)
library(tidyverse)
historical_sites <- data_frame(
lat = rnorm(10, mean = 0, sd = 5),
lon = rnorm(10, mean = 0, sd = 5),
size = runif(10, min = 3, max = 10),
label = letters[1:10]
---
title: "html-document"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
@charliejhadley
charliejhadley / example_data.R
Last active September 12, 2017 14:24
example data
example_data <- structure(list(reference.text = c("bRpDLgbjh2CGeCX", "bRpDLgbjh2CGeCX",
"bRpDLgbjh2CGeCX", "bRpDLgbjh2CGeCX", "bRpDLgbjh2CGeCX", "bRpDLgbjh2CGeCX",
"bRpDLgbjh2CGeCX", "fMDsELXVe7JWhLi", "fMDsELXVe7JWhLi", "khPPXOwUBNa9AcB",
"tGFDlIu0SvbdIyH", "MFAuW5KIgQBSvSV", "MFAuW5KIgQBSvSV", "MFAuW5KIgQBSvSV",
"MFAuW5KIgQBSvSV", "lyBVcctITtkYxBA", "lyBVcctITtkYxBA", "lyBVcctITtkYxBA",
"lyBVcctITtkYxBA", "lyBVcctITtkYxBA", "lyBVcctITtkYxBA", "lyBVcctITtkYxBA",
"H2UHirXAdc8ivjC", "H2UHirXAdc8ivjC", "H2UHirXAdc8ivjC", "H2UHirXAdc8ivjC",
"H2UHirXAdc8ivjC", "H2UHirXAdc8ivjC", "H2UHirXAdc8ivjC", "H2UHirXAdc8ivjC",
"H2UHirXAdc8ivjC", "QXFTsmsHgvKqE4m", "QXFTsmsHgvKqE4m", "CJIJvqa8e6JX7c1",
"PA77dlnPDAKpej7", "EYD8Jz3i8oIhU4N", "rnVWTKmuZct2TZp", "rnVWTKmuZct2TZp",
@charliejhadley
charliejhadley / readr_local_exported_display_main_data.csv
Created December 5, 2017 17:36
encoding difference between local and remote shinyapps.io
encoding wreckSite
unknown Caveaux
unknown Caveaux
unknown Čavlena
unknown Cavoli
unknown Cavtat
unknown Cecina
unknown Cefalu
unknown Cervia
unknown Cervo
@charliejhadley
charliejhadley / contour-data.csv
Created December 14, 2017 10:18
GIF of reversed levels in stat_density_2d plot
x y
16.7986487390868 1.67526358475264
13.2813624340074 2.22296836982968
1.02866010550767 1.13472830494728
3.9267468521368 1.60058394160584
0.701880817366005 0.978734793187346
0.966536979787071 1.05664233576643
1.12430033540043 0.909489051094893
1.79220123438857 0.824152473641526
2.14361749430718 0.93881589618816
@charliejhadley
charliejhadley / _explanation.md
Last active December 20, 2017 15:16
Newton Cooling with Purrr

Applying a function across rows of a tibble

A problem I often am faced with is applying a function to data from a simulation, for instance computing the Newton Cooling of a bunch of materials. I asked this question on Twitter https://twitter.com/JennyBryan/status/930475618210213888 and @JennyBryan provided two options for solving this problem using dplyr and purrr as comments on the newton-cooling-with-purrr.R file below.

The material properties might be provided as follows:

material_details <- tribble(
  ~material, ~k.cooling.constant,
  "copper", 0.1,