- install unixodbc using homebrew
You can install homebrew here. Once that is done, run this in the terminal.
brew install unixodbc
- Download instant client from Oracle
#' Description | |
#' This file runs a live election-night forecast based on The Economist's pre-election forecasting model | |
#' available at projects.economist.com/us-2020-forecast/president. | |
#' It is resampling model based on https://pkremp.github.io/update_prob.html. | |
#' This script does not input any real election results! You will have to enter your picks/constraints manually (scroll to the bottom of the script). | |
#' | |
#' Licence | |
#' This software is published by *[The Economist](https://www.economist.com)* under the [MIT licence](https://opensource.org/licenses/MIT). The data generated by *The Economist* are available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). | |
#' The licences include only the data and the software authored by *The Economist*, and do not cover any *Economist* content or third-party data or content made available using the software. More information about licensing, syndication and the copyright of *Economist* content can be fou |
You can install homebrew here. Once that is done, run this in the terminal.
brew install unixodbc
--- | |
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions | |
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows | |
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions | |
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions | |
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners | |
name : debug | |
on : | |
push : | |
branches : [ "master" ] |
This app requires the shiny
and xml2
packages. Run the gist interactively with the following:
shiny::runGist('6c33ee09a16d55569c562f7aa3951088')
#!/bin/bash | |
IN=$1 | |
OUT=$2 | |
true ${SD_PARAMS:="-55dB:d=0.3"}; | |
true ${MIN_FRAGMENT_DURATION:="20"}; | |
export MIN_FRAGMENT_DURATION | |
if [ -z "$OUT" ]; then |
transformers <- styler::tidyverse_style() | |
transformers$token$fix_quotes <- function (pd_flat) { | |
str_const <- pd_flat$token == 'STR_CONST' | |
str_const_change <- grepl('^"(.*)"$', pd_flat$text[str_const]) | |
raw_str <- sub('^"(.*)"$', '\\1', (pd_flat$text[str_const][str_const_change])) | |
raw_str <- gsub('(\\\\)?\'', '\\\\\'', raw_str) | |
raw_str <- gsub('\\\\"', '"', raw_str) | |
pd_flat$text[str_const][str_const_change] <- paste0('\'', raw_str, '\'') | |
pd_flat | |
} |
library(rtweet) | |
library(slickR) # remotes::install_github('metrumresearchgroup/slickR') | |
tweets <- rtweet::search_tweets("#rstats", n = 5, include_rts = FALSE) | |
# https://github.com/mkearney/rtweet/pull/305/files | |
tweet_embed <- function(screen_name,status_id,...){ | |
stem <- 'https://publish.twitter.com/oembed' | |
library(tidycensus) | |
library(mapdeck) | |
library(tidyverse) | |
token <- "your mapbox token" | |
hv <- get_acs(geography = "tract", | |
variables = "B25077_001", | |
state = "CA", | |
geometry = TRUE) %>% |
library(sf) | |
library(dplyr) | |
library(ggplot2) | |
library(gganimate) # needs development version from github | |
# helper function to place a geometric object at a desired position | |
# and scale | |
place_geometry <- function(geometry, position, scale = 1) { | |
(geometry - st_centroid(geometry)) * scale + | |
st_sfc(st_point(position)) |