Skip to content

Instantly share code, notes, and snippets.

View stephlocke's full-sized avatar

Steph Locke stephlocke

View GitHub Profile
@stephlocke
stephlocke / preconlist.md
Created April 16, 2018 11:43
Current precon offerings

Precons

Practical R for everyone

This hands-on one-day training takes you through the following topics – fundamentals of R, R for ETL, producing reports, and doing data science. Starting with some simple data manipulation, we’ll quickly progress to tools that can make an immediate impact in your day job.

  • For ETL, we’ll look at ways to import and export data, transform it, and apply data quality checks along the way.
  • For producing reports we’ll see how we can build web reports, PDFs, and interactive dashboards.
  • For data science, we’ll look at how R supports you along the process.

By the end of the day, you’ll know some R (including some advanced stuff!) that you can add to your toolbelt.

@stephlocke
stephlocke / steph.R
Created March 24, 2018 20:22
Steph blogged what?
if(!require(locketweet))
devtools::install_github("lockedata/locketweet")
library(tidyverse)
library(locketweet)
locketweet::lockedata_blog %>%
filter(date.x >= as.Date("2016-10-01"),
coalesce(tolower(author), "steph") ==
"steph") %>%
select(starts_with("cat_")) %>%
@stephlocke
stephlocke / recipe.R
Created March 15, 2018 21:11
a recipes 📦 workflow
library(recipes)
library(tidyverse)
library(AppliedPredictiveModeling)
data(AlzheimerDisease)
predictors %>%
cbind(diagnosis) ->
alzheimers
alzheimers %>%
@stephlocke
stephlocke / Checklist.md
Last active May 25, 2018 19:01
Conference good practices according to Steph!
  • Have a Code of Conduct and a demonstrable commitment to diversity
    • The Code of Conduct must be prominently displayed
    • Sponsors and other third parties must adhere to the Code of Conduct
  • Provide a mechanism for low income attendees to get reduced prices and support where the event charges more than a day's income
  • Attendees encounter only non-defaulted opt-ins to marketing and future contact, especially from third parties
  • The data entrusted to the event is handled with due care and consideration
  • Diverse attendees' needs are considered and taken into consideration. Things like (but not limited to) large print agendas, gender neutral bathrooms, quiet rooms, family rooms, and prayer rooms are implemented to ensure a pleasant experience for all attendee
  • Volunteers and organisers should receive reduced or free entry to the event
  • New speakers are encouraged and offered extra support
  • The speaker selection process is performed in a way that reduces possible sources of bias
@stephlocke
stephlocke / LockeTree.css
Last active January 5, 2018 12:50
Working Site Tree
.collapsibleTree .node circle {
fill: #E8830C;
stroke: #E8830C;
}
.collapsibleTree .node text {
fill: white;
}
.collapsibleTree .link {
@stephlocke
stephlocke / xmlprocess.R
Created December 22, 2017 19:03
xml processing
library(xml2)
library(tidyverse)
## Extract any number of xml files
list.files(pattern="*.xml") %>%
map(read_xml) %>%
## Convert to a list to process
map(as_list) %>%
## Simplify list structure
map(flatten) %>%
@stephlocke
stephlocke / datascience.R
Created October 13, 2017 09:52
data science half day
## ----setup, include=FALSE------------------------------------------------
library(learnr)
library(tidyverse)
library(modelr)
library(DBI)
library(odbc)
library(broom)
library(FFTrees)
library(caret)
## ----dbconn, eval=FALSE, echo=TRUE---------------------------------------
@stephlocke
stephlocke / chicagofood.Rmd
Created October 3, 2017 15:37
Chicago food inspection notebook
---
title: "Chicago Food Inspections"
output: html_notebook
---
```{r setup}
library(readr)
library(dplyr)
readrestaurant<-function(x){
@stephlocke
stephlocke / Prep.md
Last active October 2, 2017 18:24
Preparing for Data Science Fundamentals
library(devtools)
install_github("lockedata/pRojects")
install_github("ropenscilabs/codefinch")