0

So I have a prediction app that uses created datatables. I have all files in same directory. When I run the app in shinyapps, the application displays but the application does not respond to user input (or so it appears). But if I close browser and open again in a minute or so, the application works. The application runs correctly in RStudio.

# Top of global.R


library(data.table)
library (plyr)
library(stringr)
library(tm)

load("ngramd.RData")

nxtwd <- function(input=input) {
        input <- tolower(input)
        input <- iconv(input, "latin1", "ASCII", sub="")
        input <- removePunctuation(input)  

# Top portion of server.R 

library(shiny)

shinyServer(function(input, output,session) {
        observe({
                if (nchar(as.character(input$text)) > 0) {

I have also added the load statement above the shinyServer and get the same response.

I am using RStudio and Windows 10.

cgb
  • 1
  • 1
  • 2
    How do you know the data is not loaded in the global environment? Without a clear error message or [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) it's not clear what's going on at all. – MrFlick Jan 26 '18 at 20:36
  • Your right. It could be just not reacting to the input. I type in input nothing hapoens. Have let the program think for 15 minutes. Nothing. I check shinyapps it is running and no errors. I close browser then open one up again, enter link and then enter input. It works. – cgb Jan 27 '18 at 21:37
  • I have also determined that when the application is in a sleep state and I first enter the url in a browser, that the app is not listening. If i close the browser then reopen and enter url, this line then appears: – cgb Jan 28 '18 at 13:57
  • 2018-01-28T13:44:40.791134+00:00 shinyapps[254158]: Listening on http://127.0.0.1:36877 – cgb Jan 28 '18 at 13:57
  • Try to include [shinycssloaders](https://github.com/andrewsali/shinycssloaders) package into your app. It is easy and it will animate loading of data. I tried it for loading of quite large tables and works fine. At least you can see if the app is frozen or if it is loading data. – tlask Jan 28 '18 at 15:28

0 Answers0