Skip to content

Instantly share code, notes, and snippets.

View uribo's full-sized avatar
🍉
fine

Shinya Uryu uribo

🍉
fine
View GitHub Profile
# somewhat hackish solution to:
# https://twitter.com/EamonCaddigan/status/646759751242620928
# based mostly on copy/pasting from ggplot2 geom_violin source:
# https://github.com/hadley/ggplot2/blob/master/R/geom-violin.r
library(ggplot2)
library(dplyr)
"%||%" <- function(a, b) {
@uribo
uribo / japan_outline.geojson
Created November 24, 2016 09:22 — forked from shimizu/japan_outline.geojson
日本列島アウトライン
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uribo
uribo / notify.R
Last active March 25, 2016 22:55 — forked from hrbrmstr/notify.R
Send OS X notifications from R (RStudio, R GUI or R console)
notify <- function(msg="Operation complete") {
in.osx <- (Sys.info()['sysname'] == "Darwin")
in.rstudio <- (Sys.getenv("RSTUDIO") == "1")
in.rgui <- (Sys.getenv("R_GUI_APP_REVISION") != "")
dir.notifier <- system("which terminal-notifier", intern = TRUE)
if (in.rstudio) { # hack to see if running in RStudio
title <- "RStudio"
sender <- activate <- "org.rstudio.RStudio"
@uribo
uribo / newpkg
Last active August 29, 2015 14:23 — forked from hrbrmstr/newpkg
#!/bin/bash
# AUTHOR: Bob Rudis <bob@rudis.net> (@hrbrmstr)
# LICENSE: MIT + file zLICENSE
TODAY=`date +%Y-%m-%d`
TODAY_MD=`date +%B\ %d,\ %Y`
YEAR=`date +%Y`
PACKAGENAME=$1
@uribo
uribo / advise.md
Last active August 29, 2015 14:15 — forked from hadley/advise.md

I think the two most important messages that people can get from a short course are:

a) the material is important and worthwhile to learn (even if it's challenging), and b) it's possible to learn it!

For those reasons, I usually start by diving as quickly as possible into visualisation. I think it's a bad idea to start by explicitly teaching programming concepts (like data structures), because the pay off isn't obvious. If you start with visualisation, the pay off is really obvious and people are more motivated to push past any initial teething problems. In stat405, I used to start with some very basic templates that got people up and running with scatterplots and histograms - they wouldn't necessary understand the code, but they'd know which bits could be varied for different effects.

Apart from visualisation, I think the two most important topics to cover are tidy data (i.e. http://www.jstatsoft.org/v59/i10/ + tidyr) and data manipulation (dplyr). These are both important for when people go off and apply

@uribo
uribo / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console