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
library("tidyverse")
journeys <- read_csv("data/clean-journeys.csv")
journeys %>%
count(start.country, date)
journeys %>%
group_by(start.country) %>% # hello!
@charliejhadley
charliejhadley / navigation.html
Last active February 27, 2018 13:44
Blogpost: crawling with tidygraph
<div id="main-superfish-wrapper" class="menu-wrapper">
<ul id="menu-main-menu-1" class="sf-menu sf-js-enabled sf-shadow">
<li id="menu-item-14" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-14"><a href="http://blogs.bodleian.ox.ac.uk/rdm">Home</a></li>
<li id="menu-item-40" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-40"><a href="http://researchdata.ox.ac.uk/home/introduction-to-rdm/" class="sf-with-ul">About<span class="sf-sub-indicator"> »</span></a>
<ul class="sub-menu" style="float: none; width: 15.8462em; display: none; visibility: hidden;">
<li id="menu-item-3237" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-3237" style="white-space: normal; float: left; width: 100%;"><a href="http://researchdata.ox.ac.uk/home/what-do-i-need-to-do-now/" style="float: none; width: auto;">What do I need to do now?</a></li>
<li id="menu-item-3238" class
@charliejhadley
charliejhadley / great-circles.R
Created February 28, 2018 12:39
Great circles with sf
library("tidyverse")
#> ── Attaching packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
#> ✔ ggplot2 2.2.1.9000 ✔ purrr 0.2.4
#> ✔ tibble 1.4.2 ✔ dplyr 0.7.4
#> ✔ tidyr 0.8.0 ✔ stringr 1.2.0
#> ✔ readr 1.1.1 ✔ forcats 0.2.0
#> ── Conflicts ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
#> ✖ dplyr::filter() masks stats::filter()
#> ✖ dplyr::lag() masks stats::lag()
library("sf")
<!--html_preserve-->
<div class="row">
<div class="col-md-6">
foobar
</div>
<div class="col-md-6">
fubar
</div>
</div>
@charliejhadley
charliejhadley / httr-using-blogpost.Rmd
Created November 24, 2018 12:01
httr using blogpost
---
title: Get data
date: '2018-11-22'
slug: get-data
---
Download data
```{r}
library("rfigshare")
@charliejhadley
charliejhadley / 24-days-of-christmassy-drinks.csv
Created November 26, 2018 09:14
24 days of Christmassy drinks 2018
drink.name retailer type year
Christmas brulee latte Starbucks coffee 2018
Flat white cinnamon Starbucks coffee 2018
Toffee nut latte Starbucks coffee 2018
Gingerbread latte Starbucks coffee 2018
Eggnog latte Starbucks coffee 2018
Salted caramel brownie hot chocolate Starbucks hot chocolate 2018
Caramelised almond brittle latte Café Nero coffee 2018
Salted caramel latte Café Nero coffee 2018
Belgian truffle hot chocolate Café Nero hot chocolate 2018
@charliejhadley
charliejhadley / README.md
Created December 18, 2018 17:05
leaflet, shiny and z-index issues

z-index issues in leaflet maps and shiny apps

Dropdown menus in shiny apps (created with selectInput()) will appear below the zoom buttons in a leaflet map without intervention.

The issues is due to the z-index of the different web elements, which controls what appears on top of what. To change the z-index of the dropdown menu we can use div(control, style = "position:relative;z-index:10000;"

@charliejhadley
charliejhadley / google-doodle.Rmd
Created January 7, 2019 15:23
Show today's Google Doodle
---
title: "Google Doodle"
output: html_document
editor_options:
chunk_output_type: console
---
```{r get-google-foo-url}
library("tidyverse")
library("rvest")
@charliejhadley
charliejhadley / README.md
Created January 29, 2019 20:04
New follower follow network

BristolR Talk

This script generates a follower follow network from your most recent followers.

I ran this script during my BristolR talk, I've hard coded the followers I got during the talk

## Hard coded ids of new followers during talk
new_followers <- tibble(
 user_id = c(16307367,1571967648,9864992,1409778128, 579777616,29462710,3900399077,45871230,76908793))
@charliejhadley
charliejhadley / too_long_on_a_single_table.Rmd
Last active February 4, 2019 21:30
bookdown kable formatting
---
output: html_document
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE, message = FALSE, warning = FALSE}
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,