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) | |
| library(lubridate) | |
| server = function(input, output, session){ | |
| # type = date rolling n months, quarters | |
| output$dateControls <- renderUI({ | |
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) # load Shiny at the top of both scripts | |
| shinyServer(function(input, output) { # define application in here | |
| output$textDisplay <- renderText({ # mark function as reactive | |
| # and assign to output$textDisplay for passing to ui.R | |
| paste0("You said '", input$comment, # from the text | |
| "'. There are ", nchar(input$comment), # input control as | |
| " characters in this.") # defined in ui.R |
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
| function(input, output) { | |
| output$textDisplay <- renderTable({ | |
| getMat = matrix( | |
| c(paste(input$checkGroup, collapse=','), class(input$checkGroup), | |
| input$boxInput, class(input$boxInput), | |
| as.character(as.Date(input$theDate, origin = "1970-01-01")), class(input$theDate), | |
| paste(as.character(as.Date(input$dateRange[[1]], origin = "1970-01-01")), | |
| as.character(as.Date(input$dateRange[[2]], origin = "1970-01-01")), |
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
| #################################### | |
| ##### minimal example - server.R ### | |
| #################################### | |
| library(shiny) # load shiny at beginning at both scripts | |
| shinyServer(function(input, output) { # server is defined within these parentheses | |
| output$textDisplay <- renderText({ # mark function as reactive and assign to | |
| # output$textDisplay for passing to ui.R |
NewerOlder