Skip to content

Instantly share code, notes, and snippets.

@xiaodaigh xiaodaigh/color.js forked from anonymous/color.js
Created Sep 22, 2013

Embed
What would you like to do?
$(document).delegate("#mytable",'DOMSubtreeModified','DOMNodeInserted', function(event) {
color()
});
function color(){
$('#mytable td').each(function(){
$(this).css({'background':'#CCC'});
})
}
library(shiny)
shinyServer(function(input, output){
data <- reactive({
get(input$data)
})
output$mytable <- renderTable({data()})
})
library(shiny)
data.options<-function(){
set<-lsp(datasets)
set.class<-sapply(seq(set), function(i){ class(get(set[i]))})
set[set.class=="data.frame"] #|set.class=="matrix"
}
lsp <- function (package, all.names = FALSE, pattern) {
package <- deparse(substitute(package))
ls(pos = paste("package", package, sep = ":"), all.names = all.names,
pattern = pattern)
}
shinyUI(basicPage(
includeScript('color.js'),
selectInput("data","Data Set", data.options()),
tableOutput('mytable')
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.