Skip to content

Instantly share code, notes, and snippets.

Avatar

Emi Tanaka emitanaka

View GitHub Profile
@emitanaka
emitanaka / bitmap.R
Last active Aug 24, 2018
Making the Rladies Sydney Bitmap Animation
View bitmap.R
library(readbitmap)
library(gganimate)
library(dplyr)
library(ggplot2)
b1 <- read.bitmap("~/Documents/rladies.png")
b2 <- read.bitmap("~/Documents/sydney.png")
x1 <- 1 - b1[,,1]
x2 <- 1 - b2[,,1]
# plot(raster::raster(x1)) # check
# plot(raster::raster(x2)) # check
View emoji_calendar_2018.R
library(tidyverse)
library(lubridate)
library(sugrrants)
library(emojifont)
load.emojifont('OpenSansEmoji.ttf')
happy <- c("\U0001f606", "\U0001f603", "\U0001f64b", "\U0001f604", "\U0001f600")
sad <- c("\U0001f63f", "\U0001f622", "\U0001f62d", "\U0001f61e", "\U0001f64d")
neutral <- c("\U0001f47e", "\U0001f43a", "\U0001f438")
@emitanaka
emitanaka / harvest.R
Created Nov 22, 2018
Tractor harvesting
View harvest.R
library(tidyverse)
library(gganimate)
library(ggimage)
# make data set for movement of the tractor
harvest_df <- data.frame(
x=c(-0.375 + 0.75*(0:15), rep(-0.375 + 0.75*15, 3), -0.375 + 0.75*(15:0), rep(-0.375+0, 3),
-0.375 + 0.75*(0:15), rep(-0.375 + 0.75*15, 3), -0.375 + 0.75*(15:0), rep(-0.375+0, 3),
-0.375 + 0.75*(0:15), rep(-0.375 + 0.75*15, 3), -0.375 + 0.75*(15:0), rep(-0.375+0, 3),
-0.375 + 0.75*(0:15), rep(-0.375 + 0.75*15, 3), -0.375 + 0.75*(15:0)
@emitanaka
emitanaka / custom.css
Created Jan 4, 2019
For fixing printing from chrome for xaringan
View custom.css
/*
Below is for 16:9. Adjust to suit your own.
*/
@page {
size: 1210px 681px;
margin: 0;
}
@media print {
.remark-slide-scaler {
@emitanaka
emitanaka / graph.R
Created Jan 30, 2019
child geom point plot for CY
View graph.R
library(tidyverse)
library(ggrepel)
dat <- tibble::tribble(
~Visits, ~FEV, ~No, ~Group, ~Line, ~Child,
"0", 78, NA, "Smokers", 1, NA,
"1", 76, 2682, "Smokers", 1, 1,
"2", 74, 2335, "Smokers", 1, 2,
"3", 73, 2959, "Smokers", 1, NA,
"2", 79, 208, "Outliers", "O1", 1,
"3", 78, 152, "Outliers", "O2", 2,
View IBSlogo_animation.R
library(gganimate)
library(tidyverse)
IBSlogo <- tribble(
~Row, ~Col, ~Fill, ~Text,
3, 1, "white", "I",
3, 2, "#7fb8ff", "",
3, 3, "#0170fe", "",
2, 1, "#0170fe", "",
2, 2, "white", "B",
@emitanaka
emitanaka / hadleyinsydney.R
Last active May 1, 2019
Hadley in Sydney Public Lecture
View hadleyinsydney.R
# the power of piping + functional programming + stringr + some gluing <3
library(tidyverse)
tidyverse <- "Hadley"
"You're" -> Hadley
"super" -> Thanks
"{tidyverse} is awesome" %>%
str_glue() %>%
View keybase.md

Keybase proof

I hereby claim:

  • I am emitanaka on github.
  • I am emitanaka (https://keybase.io/emitanaka) on keybase.
  • I have a public key ASBn0EYjrw-NsypB8fDZvX1xNNWZPPkVzwt2bupVc7zt6Ao

To claim this, I am signing this object:

@emitanaka
emitanaka / buggy_slide_with_fix.Rmd
Created Sep 11, 2019
xaringan ninjutsu remark.js bug
View buggy_slide_with_fix.Rmd
---
output:
xaringan::moon_reader:
css: "ninjutsu"
seal: false
---
class: split-40
count: false
@emitanaka
emitanaka / example.html
Created Sep 11, 2019
remark.js bug - unclosed square bracket
View example.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<style>
.column1, .column2 {
position: absolute;
top:0;
width:50%;
}