Last active
June 2, 2021 15:24
-
-
Save Inkimar/8b71092b663be1bed167dda7ad084349 to your computer and use it in GitHub Desktop.
Server.R ( och shiny)
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) #load shiny at beginning 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 | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ui.R -> a minimal example
shinyUI(fluidPage( # flexible layout function
Title
titlePanel("Den minimala applikationen"),
sidebarLayout(
sidebarPanel(
textInput(inputId = "comment", # this is the name of the
# variable- this will be passed to server.R
label = "Säg något", # display label for the variable
value = "" # initial value
)
))