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
FROM ubuntu:14.04 | |
MAINTAINER Winston Chang "winston@rstudio.com" | |
# ===================================================================== | |
# R | |
# ===================================================================== | |
# Need this to add R repo | |
RUN apt-get update && apt-get install -y software-properties-common |
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
# Suppose a function has an argument "x". If a "child function" has multiple | |
# argument beginning with "x" and I want to pass the param "x" to its parent, | |
# I get error: `argument n matches multiple formal arguments` | |
# The reason this happens is clear, but at 3am my brain is firing blanks | |
# trying to find a solution. Help! | |
library(magrittr) | |
foo <- function(x, ...) UseMethod("foo") | |
foo.parent <- function(x, n = 5, ...) n |
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
setup.sh | |
token |
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
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.PrintStream; | |
public class Main { | |
public static void main(String[] args){ | |
try{ | |
//Write out to file assuming IntelliJ project layout. | |
PrintStream out = new PrintStream(new FileOutputStream("src/timing.txt")); |
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
require(shiny) | |
shinyServer(function(input, output) { | |
val <- reactive({ | |
if(input$change>0) { | |
# Option 1 | |
'abc' | |
# # Option 2 | |
# isolate({ |
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
getLocalGist <- function(gistID, dirName){ | |
url <- paste0("https://gist.github.com/",gistID,"/download") | |
if (shiny:::download(url, paste0(dirName,".tar.gz"), mode = "wb", quiet = TRUE) != 0) | |
stop("Failed to download URL ", url) | |
gistName <- shiny:::untar2(paste0(dirName,".tar.gz"), list=TRUE)[1] | |
shiny:::untar2(paste0(dirName,".tar.gz")) | |
#file.rename seems to be pretty fragile, but this seems to be working... | |
dir.create(dirName) |
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(shiny) | |
shinyServer(function(input, output) { | |
dataset = reactive({ | |
infile = input$file1 | |
if (is.null(infile)) |
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(shiny) | |
library(mclust) | |
shinyServer(function(input, output, session) { | |
# Create a spot where we can store additional | |
# reactive values for this session | |
val <- reactiveValues(x=NULL, y=NULL) | |
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
# Define a dataset globally which will be available | |
# both to the UI and to the server. | |
# Rely on the 'WorldPhones' dataset in the datasets | |
# package (which generally comes preloaded). | |
library(datasets) | |
# Trim out the non-consecutive year from |