View news-orgs-early.R
This file contains 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(gt) | |
library(tidyverse) | |
# Table reading | |
news_orgs <- | |
readr::read_csv( | |
file = 'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-04-05/news_orgs.csv', | |
col_types = cols( | |
publication_name = col_character(), | |
parent_publication = col_character(), |
View gh_issue_labels.R
This file contains 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(usethis) | |
labels <- | |
c( | |
"Blocked (╥﹏╥)", | |
"Difficulty: ③ Advanced", | |
"Difficulty: ② Intermediate", | |
"Difficulty: ① Novice", | |
"Effort: ③ High", | |
"Effort: ② Medium", |
View information_palmerpenguins.R
This file contains 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(pointblank) | |
library(palmerpenguins) | |
informant_pp <- | |
create_informant( | |
read_fn = ~ palmerpenguins::penguins, | |
tbl_name = "penguins", | |
label = "The `penguins` dataset from the **palmerpenguins** 📦." | |
) %>% | |
info_columns( |
View gtcars_rtf.R
This file contains 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(gt) | |
library(tidyverse) | |
order_countries <- c("Germany", "Italy", "United States", "Japan") | |
best_gas_mileage_city <- | |
gtcars %>% | |
dplyr::arrange(desc(mpg_c)) %>% | |
dplyr::slice(1) %>% | |
dplyr::mutate(car = paste(mfr, model)) %>% |
View tests_informant-revenue-postgres.R
This file contains 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(pointblank) | |
library(here) | |
library(intendo) | |
# Note: while this table is hosted on a database, the table can be obtained | |
# from the {intendo} package (https://github.com/rich-iannone/intendo) | |
informant_revenue_postgres <- | |
create_informant( | |
read_fn = |
View reencode_utf8.R
This file contains 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
reencode_utf8 <- function(x) { | |
# Ensure that we encode non-UTF-8 strings to UTF-8 in a | |
# two-step process: (1) to native encoding, and then | |
# (2) to UTF-8 | |
if (Encoding(x) != 'UTF-8') { | |
x <- enc2utf8(x) | |
} | |
# Use `iconv()` to convert to UTF-32 (big endian) as |
View gist:1da1ae7a7203958a0c5b1bd1d4b24017
This file contains 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(paletteer) | |
library(gt) | |
pizzaplace %>% | |
mutate(type = case_when( | |
type == "chicken" ~ "chicken (pizzas with chicken as a major ingredient)", | |
type == "classic" ~ "classic (classical pizzas)", | |
type == "supreme" ~ "supreme (pizzas that try a little harder)", | |
type == "veggie" ~ "veggie (pizzas without any meats whatsoever)", |
View pointblank_demo.R
This file contains 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(pointblank) | |
library(log4r) | |
library(blastula) | |
# Create a connection to the game analytics data | |
# This is the `intendo` database | |
con <- | |
DBI::dbConnect( | |
drv = RMariaDB::MariaDB(), | |
dbname = Sys.getenv("DBNAME"), |
View gist:b381d687696aaa71a4548e92debe217d
This file contains 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
modify_rows <- function(df, rows, func) { | |
df[rows,] <- func(df[rows,]) | |
df | |
} | |
modify_rows(tbl, tbl$locname == "column_group", function(tbl) { | |
tbl <- tbl %>% mutate(colname | |
}) |
View yr_daily_rainfall_2015.R
This file contains 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
# Load in several packages | |
devtools::install_github("rich-iannone/DiagrammeR") | |
library(DiagrammeR) | |
library(DiagrammeRsvg) | |
library(magrittr) | |
library(stationaRy) | |
library(dplyr) | |
# Get the daily rainfall values (in mm) during 2015 at | |
# the Vancouver Internation Airport (YVR) |
NewerOlder