Skip to content

Instantly share code, notes, and snippets.

View trestletech's full-sized avatar

Jeff Allen trestletech

View GitHub Profile
# 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
FROM ubuntu:14.04
MAINTAINER Winston Chang "[email protected]"
# =====================================================================
# R
# =====================================================================
# Need this to add R repo
RUN apt-get update && apt-get install -y software-properties-common
library(shiny)
library(ggplot2)
authorized <- TRUE
shinyServer(function(input, output, session) {
if (authorized) {
data <- iris
p <- qplot(Sepal.Width, Sepal.Length, data = iris, color = Species)
@trestletech
trestletech / server.R
Last active August 29, 2015 13:57 — forked from garrettgman/server.R
library(shiny)
library(ggplot2)
shinyServer(function(input, output, session) {
if (!is.null(session$user)) {
data <- iris
p <- qplot(Sepal.Width, Sepal.Length, data = iris, color = Species)
output$ui <- renderUI({
navbarPage(
@trestletech
trestletech / global.R
Last active May 30, 2017 10:44 — forked from jpd527/server.R
sortListInput <- function(inputId,data) {
tagList(
singleton(tags$head(tags$script(src = "js/sortList.js"))),
HTML(paste('
<script>
$(function() {
$( ".sortableList" ).sortable();
$( ".sortableList" ).disableSelection();
});