Skip to content

Instantly share code, notes, and snippets.

Avatar
🦑
Tappity tap tap

Mark MarkEdmondson1234

🦑
Tappity tap tap
View GitHub Profile
@MarkEdmondson1234
MarkEdmondson1234 / app.R
Last active Jan 25, 2021 — forked from jcheng5/app.R
Using OAuth2 with Shiny
View app.R
library(shiny)
# WARNING: This sketch does not make proper use of the "state" parameter.
# Doing so usually involves using cookies, which can be done with the
# Rook package but I have not done that here. If you choose to use this
# approach in production, please check the state parameter properly!
APP_URL <- if (interactive()) {
# This might be useful for local development. If not, just hardcode APP_URL
# to the deployed URL that you'll provide a few lines below.
View AWS-furrr.R
# This example demonstrates running furrr code distributed on 2 AWS instances ("nodes").
# The instances have already been created.
library(future)
library(furrr)
# Two t2.micro AWS instances
# Created from http://www.louisaslett.com/RStudio_AMI/
public_ip <- c("34.205.155.182", "34.201.26.217")
View AdobeAnalytics-GovernanceExport.R
library("RSiteCatalyst")
library("dplyr")
SCAuth("peter.meyer@xxx.com:xxx", "xxx")
reportSuites <- GetReportSuites()
evar <- GetEvars(reportSuites$rsid) #%>%
# reportSuite <- reportSuites$rsid
View visgreatlessfilling.r
# devtools::install_github("hrbrmstr/vegalite")
library(vegalite)
library(htmltools)
dat <- jsonlite::fromJSON('[
{"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43},
{"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53},
{"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52}
]')
@MarkEdmondson1234
MarkEdmondson1234 / global.R
Created Dec 1, 2017 — forked from raymondben/global.R
gauth shiny example
View global.R
library(googleAuthR)
library(shiny)
library(shinyjs)
@MarkEdmondson1234
MarkEdmondson1234 / knit_cloudstorage.rmd
Created Apr 21, 2017 — forked from mwhitaker/knit_cloudstorage.rmd
Use googleCloudStorageR to automatically upload to Cloud Storage
View knit_cloudstorage.rmd
---
title: "Host image files on Google Cloud storage"
author: "Michael Whitaker"
date: "January 12, 2017"
output:
html_document:
self_contained: false
---
```{r setup, include=FALSE}
View japan_pyramid.R
library(idbr) # devtools::install_github('walkerke/idbr')
library(ggplot2)
library(animation)
library(dplyr)
library(ggthemes)
idb_api_key("Your Census API key goes here")
male <- idb1('JA', 2010:2050, sex = 'male') %>%
mutate(POP = POP * -1,
@MarkEdmondson1234
MarkEdmondson1234 / costdata.gs
Created Feb 15, 2016 — forked from chipoglesby/costdata.gs
Cost Data Upload via Google Analytic's Management API with Google Sheets
View costdata.gs
function uploadData() {
var accountId = "xxxxxxxx";
var webPropertyId = "UA-xxxxxxxx-x";
var customDataSourceId = "xxxxxxxx";
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var maxRows = ss.getLastRow();
var maxColumns = ss.getLastColumn();
var data = [];
for (var i = 1; i < maxRows;i++) {
data.push(ss.getRange([i], 1,1, maxColumns).getValues());
@MarkEdmondson1234
MarkEdmondson1234 / animate.R
Created Feb 8, 2016 — forked from thomasp85/animate.R
Animating graph over time
View animate.R
library(ggraph)
library(gganimate)
library(igraph)
# Data from http://konect.uni-koblenz.de/networks/sociopatterns-infectious
infect <- read.table('out.sociopatterns-infectious', skip = 2, sep = ' ', stringsAsFactors = FALSE)
infect$V3 <- NULL
names(infect) <- c('from', 'to', 'time')
infect$timebins <- as.numeric(cut(infect$time, breaks = 100))
# We want that nice fading effect so we need to add extra data for the trailing