Skip to content

Instantly share code, notes, and snippets.

View jcheng5's full-sized avatar

Joe Cheng jcheng5

View GitHub Profile
@jcheng5
jcheng5 / global.R
Last active November 30, 2022 02:01 — forked from dgrapov/global.R
#initialize
library(datasets)
library(ggplot2)
#helper function (convert vector to named list)
namel<-function (vec){
tmp<-as.list(vec)
names(tmp)<-as.character(unlist(vec))
tmp
}
@jcheng5
jcheng5 / server.R
Created August 14, 2013 06:53 — forked from tcash21/server.R
require(shiny)
require(rCharts)
inputChoices <- c("A", "B", "C", "D")
shinyServer(function(input, output, session){
input2Choices <- reactive({
inputChoices[-grep(input$input1, inputChoices)]
})
library(shiny)
library(datasets)
shinyServer(function(input, output) {
## Inputs;
output$uitextInput <- renderUI({
textInput("caption", "Caption:", "Data Summary")
})
@jcheng5
jcheng5 / DESCRIPTION
Last active August 29, 2015 13:57 — forked from trestletech/server.R
Title: Telephones by region
Author: Jeff Allen <jeff@rstudio.com>
AuthorUrl: http://www.rstudio.com/
License: MIT
DisplayMode: Showcase
Tags: sidebarlayout helptext selectinput
Type: Shiny
# 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
@jcheng5
jcheng5 / DESCRIPTION
Last active August 29, 2015 13:57 — forked from trestletech/server.R
Title: Dynamic Clustering
Author: Jeff Allen <jeff@rstudio.com>
AuthorUrl: http://www.rstudio.com/
License: MIT
DisplayMode: Showcase
Tags: mclust clustering clickid observe isolate
Type: Shiny
@jcheng5
jcheng5 / DESCRIPTION
Last active August 29, 2015 13:57 — forked from trestletech/server.R
Title: Basic DataTable
Author: Jeff Allen <jeff@rstudio.com>
AuthorUrl: http://www.rstudio.com/
License: MIT
DisplayMode: Showcase
Tags: mtcars selectinput datatables
Type: Shiny
@jcheng5
jcheng5 / server.R
Last active April 17, 2018 01:32 — forked from Athospd/server.R
library(shiny)
library(magrittr)
shinyServer(function(input, output, session) {
#__________________________________________________________________________________
# The main named list that will be used in many other tasks.
listN <- reactiveValues()
makeReactiveBinding("listN")
@jcheng5
jcheng5 / app.R
Last active November 19, 2015 19:55 — forked from klittle314/app.R
Test Shiny app: submit and clear
#test app to load the form and clear it for second record entry
#Kevin Little, Ph.D. 18 Nov 2015
require(shiny)
require(shinyapps)
require(shinyjs)
#local df taking the place of a Google sheet
df1 <- data.frame(name="name1", stringsAsFactors = FALSE)
@jcheng5
jcheng5 / app1.R
Last active February 25, 2016 16:18 — forked from Vestaxis/app1.R
Three Shiny apps that export UI components to a separate Shiny module.
# Simple example of exporting UI to another function (this works)
library(shiny)
tabUI <- function(id) {
ns <- NS(id)
fluidRow(
textOutput(ns("filter"))
)
}