Skip to content

Instantly share code, notes, and snippets.

Emi Tanaka emitanaka

Block or report user

Report or block emitanaka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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
@emitanaka
emitanaka / ggplot_tutorial.Rmd
Last active Mar 30, 2020
ggplot tutorial with kunoichi + ninjutsu xaringan theme
View ggplot_tutorial.Rmd
---
title: "ggplot tutorial"
subtitle: "with kunoichi + ninjutsu theme"
author: "<br><br> Emi Tanaka"
date: "<br>2018/09/16"
output:
xaringan::moon_reader:
lib_dir: libs
css: ["kunoichi", "ninjutsu"]
nature:
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 / collapseoutput.js
Created Jul 20, 2019
Collapsible Code Output for `xaringan`
View collapseoutput.js
<script>
(function() {
var divHTML = document.querySelectorAll(".details-open");
divHTML.forEach(function (el) {
var preNodes = el.getElementsByTagName("pre");
var outputNode = preNodes[1];
outputNode.outerHTML = "<details open class='output'><summary>Output</summary>" + outputNode.outerHTML + "</details>";
})
})();
(function() {
You can’t perform that action at this time.