Guest User

Untitled

a guest
Apr 26th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. server <- function(input, output) {
  2. output$plot <- renderPlot({
  3. file1 <- input$file1
  4. file2 <- input$file2
  5. if (is.null(file1) && is.null(file2))
  6. return(NULL)
  7.  
  8. if (!is.null(file1)) {
  9. in2 <- pdf_text(file1$datapath)
  10. }
  11. if (!is.null(file2)) {
  12. in2 <- readLines(file2$datapath)
  13. }
  14.  
  15. ui <- shinyUI(fluidPage(
  16. titlePanel("Textmining Tool v0.1"),
  17. sidebarLayout(
  18. sidebarPanel(
  19. fileInput('file1', 'Choose PDF',
  20. accept = c('text/pdf',
  21. '.pdf')),
  22. fileInput(
  23. 'file2',
  24. 'Choose TXT,CSV', multiple = T,
  25. accept = c(
  26. 'text/csv',
  27. 'text/comma-separated-values',
  28. 'text/tab-separated-values',
  29. 'text/plain',
  30. '.csv',
  31. '.tsv'
  32. )
  33. ),
  34.  
  35. fileInput(
  36. 'pos',
  37. 'Choose pos',
  38. accept = c(
  39. 'text/csv',
  40. 'text/comma-separated-values',
  41. 'text/tab-separated-values',
  42. 'text/plain',
  43. '.csv',
  44. '.tsv'
  45. )
  46. ),
  47.  
  48. fileInput(
  49. 'neg',
  50. 'Choose neg',
  51. accept = c(
  52. 'text/csv',
  53. 'text/comma-separated-values',
  54. 'text/tab-separated-values',
  55. 'text/plain',
  56. '.csv',
  57. '.tsv'
  58. )
  59. ),
  60. sliderInput(
  61. "freq",
  62. "Minimum Frequency:",
  63. min = 1,
  64. max = 50,
  65. value = 15
  66. ),
  67. sliderInput(
  68. "max",
  69. "Maximum Number of Words:",
  70. min = 1,
  71. max = 300,
  72. value = 100
  73. ),
  74.  
  75. textInput("v", "Input correlation word", "")
  76. ),
  77.  
  78. mainPanel(
  79. tabsetPanel(
  80. type = "pills",
  81. tabPanel("Wordcloud", plotOutput("plot")),
  82. tabPanel("Wordcorrelation",DT::dataTableOutput("table")),
  83. tabPanel("Sentimentanalysys", textOutput("sent")),
  84. tabPanel("Most Frequent", DT::dataTableOutput("2"))
  85. )
  86. )
  87. )
  88. ))
Add Comment
Please, Sign In to add comment