fork download
  1. #server.r
  2. shinyServer(function(input, output) {
  3.  
  4. output$text1 <- renderText({
  5. #zz = file('filename.txt','a+')
  6. zz = file('filename.txt','a+')
  7. writeLines(paste(input$Login_User,':',input$Message),zz)
  8. close(zz)
  9. dd=readLines('filename')
  10. dd
  11. })
  12. })
  13.  
  14.  
  15.  
  16. #ui.r
  17. #輸入框
  18. textareaInput <- function(id, label, value, rows=20, cols=20, class="form-control"){
  19. tags$div(
  20. class="form-group shiny-input-container",
  21. tags$label('for'=id,label),
  22. tags$textarea(id=id,class=class,rows=rows,cols=cols,value))
  23. }
  24. library(shiny)
  25.  
  26. # Define UI for dataset viewer application
  27. shinyUI(fixedPage(
  28. #標題
  29. titlePanel("Demo ShinyApp"),
  30. #左邊
  31. sidebarLayout(
  32. sidebarPanel(
  33. textInput(inputId="Login_User", label="User", value = ''),
  34. textInput(inputId="Login_Num", label="Number", value = ''),
  35. submitButton("Start Work")
  36. ),
  37. #右邊
  38. mainPanel(
  39. tabsetPanel(
  40. tabPanel('SendText',
  41. br(),
  42. h3('Bulletin Board'),
  43. tags$textarea(id="Message", rows=5, cols=50, "Leave Message"),
  44. br(),
  45. verbatimTextOutput("text1")
  46. )
  47. )
  48. )
  49. )
  50. ))
Success #stdin #stdout #stderr 0.47s 79168KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: could not find function "shinyServer"
Execution halted