Skip to content

Instantly share code, notes, and snippets.

evalparse xiaodaigh

Block or report user

Report or block xiaodaigh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View server.R
require(shiny)
require(rCharts)
inputChoices <- c("A", "B", "C", "D")
shinyServer(function(input, output, session){
input2Choices <- reactive({
inputChoices[-grep(input$input1, inputChoices)]
})
View react log.r
?showReactLog
options(shiny.reactlog=TRUE);
session$sendCustomMessage(type="jsCode",
list(code= paste("$('#",id,"').prop('disabled',true)"
,sep="")))
tags$head(tags$script(HTML('
Shiny.addCustomMessageHandler("jsCode",
@xiaodaigh
xiaodaigh / server.R
Created Oct 1, 2013
Shiny output doesn't run if no input?
View server.R
library(shiny)
library(shinyIncubator)
options(shiny.reactlog=TRUE);
shinyServer(function(input, output,session) {
output$test <- renderPlot({
input$meh
print("wassup")
withProgress(session, min=1, max=15, {
@xiaodaigh
xiaodaigh / server.R
Last active Apr 12, 2016
Shiny: Disable Button
View server.R
library(shiny)
disableActionButton <- function(id,session) {
session$sendCustomMessage(type="jsCode",
list(code= paste("$('#",id,"').prop('disabled',true)"
,sep="")))
}
shinyServer(function(input, output,session) {
@xiaodaigh
xiaodaigh / server.r
Created Oct 12, 2013
Shiny R - Re-initialise reactive values
View server.r
library(shiny)
shinyServer(function(input,output){
reval <- reactiveValues(a= 1,b=2,dummy= rnorm(1))
observe({
if(input$hello == 0) return()
random.number <- rnorm(1)
reval$dummy <- random.number
b <- reval$b
@xiaodaigh
xiaodaigh / README.md
Last active Feb 1, 2017
== actionButton styling == The Twitter Bootstrap allows for many class styles for buttons. http://getbootstrap.com/2.3.2/base-css.html#buttons Added support for these styles to the actionButton.
View README.md
@xiaodaigh
xiaodaigh / server.r
Last active Feb 2, 2016
R Shiny: An textInput that only gets invalidated upon losing focus or when enter is pressed shiny::runGist("7150112")
View server.r
library(shiny)
shinyServer(function(input, output, session) {
# Partial example
output$meh <- renderPrint({
print("Press enter or focusout to update --- ")
print(input$myTextInput )
@xiaodaigh
xiaodaigh / server.r
Created Oct 25, 2013
R Shiny Password Input
View server.r
library(shiny)
shinyServer(function(input, output, session) {
# Partial example
output$meh <- renderPrint({
print("Meh --- ")
print(input$myTextInput )
print(input$passInput )
})
View A simple visual variable clustering algorithm
data <- read.csv("c:/bb2.csv")
cor.data <- cor(data[sapply(data,typeof)=="double"],method="spearman")
dist <- function(y,x) {
if(is.null(dim(x))) {
sqrt((x[1] - y[1])^2 + (x[2] - y[2])^2)
} else {
sqrt((x[,1] - y[1])^2 + (x[,2] - y[2])^2)
}
@xiaodaigh
xiaodaigh / server.r
Created Dec 16, 2013
Shiny callback mechanism
View server.r
#install.packages(c("devtools","svSockets")) # if not already installed
#devtools::install_github("gosocket","analytixware") # if not already installed
#devtools::install_github("shinysky","analytixware") # if not already installed
library(shiny)
library(shinysky)
library(gosocket)
# Define server logic required to generate and plot a random distribution
shinyServer(function(input, output,session) {
You can’t perform that action at this time.