Last active
October 23, 2015 23:38
-
-
Save jhollist/eb5fabf42cc1181c7508 to your computer and use it in GitHub Desktop.
This file contains 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) | |
library(dplyr) | |
library(DT) | |
dat<-data.frame(letters=c(rep("A",15),rep("B",5),rep("C",5))) | |
server<-shinyServer(function(input, output) { | |
#Returns filtered data | |
output$dat_false <- renderDataTable(dat,filter = "top",server = FALSE) | |
#Returns just the currently (?) visible values in the mainPanel | |
output$dat_true <- renderDataTable(dat,filter = "top",server = TRUE) | |
#This code modifeied from: https://yihui.shinyapps.io/DT-info/ | |
output$x5 = renderPrint({ | |
cat('\n\nAll rows with server = TRUE:\n\n') | |
cat(input$dat_true_rows_all, sep = ', ') | |
cat('\n\nAll rows with server = FALSE:\n\n') | |
cat(input$dat_false_rows_all, sep = ', ') | |
}) | |
}) | |
ui<-shinyUI( | |
fluidPage( | |
sidebarLayout( | |
sidebarPanel(verbatimTextOutput('x5')), | |
mainPanel(dataTableOutput("dat_true"), | |
dataTableOutput("dat_false")) | |
) | |
) | |
) | |
shinyApp(ui,server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment