-
-
Save xiaodaigh/6662247 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$(document).delegate("#mytable",'DOMSubtreeModified','DOMNodeInserted', function(event) { | |
color() | |
}); | |
function color(){ | |
$('#mytable td').each(function(){ | |
$(this).css({'background':'#CCC'}); | |
}) | |
} |
This file contains hidden or 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){ | |
data <- reactive({ | |
get(input$data) | |
}) | |
output$mytable <- renderTable({data()}) | |
}) |
This file contains hidden or 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) | |
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