Skip to content

Instantly share code, notes, and snippets.

View yjunechoe's full-sized avatar
🐣

June Choe yjunechoe

🐣
View GitHub Profile
library(tidyverse)
library(ggtext)
library(ragg)
alarm_tbl <- tribble(
~hour, ~minute,
7, 38,
7, 40,
7, 47,
8, 17,
library(dplyr)
library(ggplot2)
library(googleAnalyticsR)
website_data <- google_analytics(
ga_account_list()[[1, "viewId"]],
date_range = c(as.Date("2020-09-01"), Sys.Date()),
metrics = c("pageviews", "users"),
dimensions = "date"
) %>%
library(dplyr)
library(ggplot2)
library(gganimate)
library(string2path)
magic <- string2path(
"MAGIC",
paste0(Sys.getenv("FONT_PATH"), "xkcd.ttf")
)
library(ggplot2)
library(dplyr)
library(ragg)
tibble(x = 2019:2021, y = c(3764, 2520, 947)) %>%
ggplot(aes(x, y)) +
geom_line(
size = 2,
linetype = "53"
) +
@yjunechoe
yjunechoe / r2d3_test.js
Created July 8, 2021 10:09
Interactive scatterplot - A test run of R2D3
// !preview r2d3 data=tibble::rownames_to_column(mtcars), container="div", d3_version = 6
const buttonContainer = div.append("div")
.attr("id", "buttons")
const buttonX = buttonContainer
.append("label")
.attr("class", "button-label")
.style("font-weight", "bold")
.text("X Variable: ")
@yjunechoe
yjunechoe / interactive.Rmd
Created July 11, 2021 07:55
interactive rmarkdown code blocks
---
title: "interactive"
output:
html_document:
highlight: tango
---
<script src="https://d3js.org/d3.v7.js"></script>
<style>
@yjunechoe
yjunechoe / r2d3_crosstalk.Rmd
Created July 29, 2021 12:30
{r2d3} + {crosstalk}
---
title: "r2d3 fun2"
output:
html_document:
highlight: tango
---
```{r}
r2d3_xtalk <- function(...) {
@yjunechoe
yjunechoe / read_pcibex
Last active August 17, 2022 22:47
Read the results from a PCIbex experiment
####
##
## Script by June Choe
## Last updated 08/2022
##
####
#' Read the results from a PCIbex experiment
#'
#' Converts a comma-separated PCIbex results file into rectangular format.
@yjunechoe
yjunechoe / rectangular_summarize.R
Last active September 26, 2021 19:17
multi-row multi-column summarize with a tibble passed into the ...
library(dplyr)
mtcars %>%
group_by(cyl) %>%
summarize(tibble::enframe(quantile(mpg, c(0.25, 0.5, 0.75)), name = "quantile", value = "mpg"), .groups = 'drop')
#> # A tibble: 9 x 3
#> cyl quantile mpg
#> <dbl> <chr> <dbl>
#> 1 4 25% 22.8
library(ggplot2)
# This retrieves the function body
body(get("compute_group", StatCount))
# This splits the execution sequence as a list
as.list(body(get("compute_group", StatCount)))
# The trace call
trace(