Skip to content

Instantly share code, notes, and snippets.

View gadenbuie's full-sized avatar

Garrick Aden-Buie gadenbuie

View GitHub Profile
library(tidyverse)
fl_zip <- read_csv("https://raw.githubusercontent.com/gadenbuie/covid19-florida/master/data/covid-19-florida_arcgis_cases-by-zip.csv")

vec_proxy.sfc <- function(x) {
  class(x) <- setdiff(class(x), "sfc")
  vctrs::vec_proxy(x)
}

fl_counties <-
library(purrr)
# https://health.appliedxl.com/preparedness
covid_preparedness_score <-
jsonlite::read_json("https://health.appliedxl.com/jsons/health.json") %>%
map_dfr(~ .)
library(tidyverse)

cvd_states <- read_csv(
  "https://covidtracking.com/api/v1/states/daily.csv",
  col_types = cols(
    .default = col_double(),
    date = col_date("%Y%m%d"),
    state = col_character(),
    hash = col_character(),
#' Restart RStudio
#'
#' @id 6
#' @interactive
usethis:::restart_rstudio
#' Go to Source File Location
#'
#' @description Navigate to current source file in Files pane
#' @id 1
@gadenbuie
gadenbuie / check-urls.R
Last active May 8, 2020 13:54
check a page or blog post for valid urls
library(dplyr)
library(purrr)
library(stringr)
library(rvest)
library(crul)
base_url <- "https://deploy-preview-NN--USERNAME.netlify.app/"
page_url <- file.path(base_url, "blog/post")
page <- read_html(page_url)
@gadenbuie
gadenbuie / epoxyHTML_app.R
Last active May 9, 2020 19:42
Demo of epoxyHTML()
library(shiny)
library(epoxy) # gadenbuie/epoxy
ui <- fluidPage(
h2("epoxyHTML demo"),
epoxyHTML(
'test', # output id
# Regular Shiny elements
fluidRow(
tags$div(
`%>%` <- magrittr::`%>%`
tumors <- tibble::tribble(
~mrn, ~sequence, ~age, ~tumor_size, ~tumor_unit,
289034L, 1L, 47L, 0.9, "cm",
289034L, 2L, 47L, 35.2, "mm",
290660L, 1L, 49L, 30, "mm",
290660L, 2L, 49L, 15.5, "mm",
341050L, 1L, 61L, 14.7, "mm",
341050L, 2L, 70L, 2.1, "cm",
---
pagetitle: Inline Text Input Example
example:
title: Inline Text Input Example
runtime: repl
mode:
document: html
initial:
js: |-
let inlineInputs = document.querySelectorAll('.inline-text-input input[type="text"]')
library(shiny)
# remotes::install_github("gadenbuie/epoxy@shiny-inline-inputs")
library(epoxy)
# Module ------------------------------------------------------------------
epoxyModTestUI <- function(id) {
ns <- NS(id)
tagList(
h2("Is it rainy there?"),
epoxyHTML(
# Step 1 ------------------------------------------------------------------
# Before updating R...
`%>%` <- magrittr::`%>%`
# Thanks Chuck Powell - https://ibecav.github.io/update_libraries/
package_source <- function(pkg){
x <- as.character(packageDescription(pkg)$Repository)
if (length(x)==0) {