Skip to content

Instantly share code, notes, and snippets.

View sckott's full-sized avatar
😸

Scott Chamberlain sckott

😸
View GitHub Profile
library(cli)
library(rlang)
assert1 <- function(x, y, arg = caller_arg(x)) {
  if (!inherits(x, y)) {
    abort(format_error("{.strong {arg}} must be of class {y}"))
 }
@sckott
sckott / privileges.R
Last active October 16, 2024 22:44
Privileges with dbplyr/dplyr
library(DBI)
library(RPostgres)
library(dplyr)
library(dbplyr)
con <- dbConnect(Postgres())
dbExecute(con, "CREATE ROLE admin")
dbExecute(con, "CREATE ROLE alice")
@sckott
sckott / safeerror.R
Last active February 26, 2024 23:10
safeError behavior in observeEvent vs. eventReactive
library(shiny)
library(bslib)
library(ggplot2)
ui <- page_sidebar(
title = h1(
class = "bslib-page-title",
"Errors when bins == 29"
),
@sckott
sckott / stuff.md
Created October 11, 2022 01:35
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@sckott
sckott / stuff.md
Created October 11, 2022 01:34
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@sckott
sckott / stuff.md
Created October 11, 2022 01:33
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@sckott
sckott / stuff.md
Created October 11, 2022 01:33
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@sckott
sckott / stuff.md
Created October 11, 2022 01:27
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@sckott
sckott / stuff.md
Created October 11, 2022 01:27
gist gist gist

Stuff and things

head of mtcars

head(mtcars)
@sckott
sckott / stuff.md
Created October 11, 2022 01:27
gist gist gist

Stuff and things

head of mtcars

head(mtcars)