This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(ggtext) | |
library(ragg) | |
alarm_tbl <- tribble( | |
~hour, ~minute, | |
7, 38, | |
7, 40, | |
7, 47, | |
8, 17, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(ggplot2) | |
library(gganimate) | |
library(string2path) | |
magic <- string2path( | |
"MAGIC", | |
paste0(Sys.getenv("FONT_PATH"), "xkcd.ttf") | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
) + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// !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: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "interactive" | |
output: | |
html_document: | |
highlight: tango | |
--- | |
<script src="https://d3js.org/d3.v7.js"></script> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "r2d3 fun2" | |
output: | |
html_document: | |
highlight: tango | |
--- | |
```{r} | |
r2d3_xtalk <- function(...) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### | |
## | |
## 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |