req() error using the "select repetitive options" script in R Shiny courtesy of Mike Badescu

Hi all,
I wondering if anyone can urgently provide me with a solution to my problem.
I am using Mike Badescus script/work-around to enable selecting repetitive options" when selecting inputs in R shiny. The script is descrbed in the following link/thread:

I get the following error when trying to implement it:
Error in seq.default: 'to' must be of length 1

Below is the Backtrace I believe in reverse order):
1: execCallbacks(timeoutSecs, all, loop$id)
2: run_now(timeoutMs/1000, all = FALSE)
3: service(timeout)
4: serviceApp()
5: ..stacktracefloor..(serviceApp())
6: withCallingHandlers(expr, error = doCaptureStack)
7: domain$wrapSync(expr)
8: promises::with_promise_domain(createStackTracePromiseDomain(),
9: captureStackTraces({
10: ..stacktraceoff..(captureStackTraces({
11: runApp()

The error occurs when I choose a value more than once, if i choose different values there are no issues. I am implementing the script very straight forward in a function that sources a script in a separate file.
NOTE: If I run the function outside of R shiny, choosing repetitive values works fine, so I know that everything except R shiny works fine. I am also using the latest versions of both R shiny v 1.6.0 and R-4.1.1

I would appreciate if someone urgently provided me with a solution, thanks in advance

Hi,

I was able to run the old script w/o any problem - this is puzzling. I copied my old scrip as is to a new file called app.R and pressed Run App

I am on Windows 10, with a fresh install of R 4.1.1, Shiny 1.6.0, RStudio 1.4.1717. I can select multiple "No"s and "Yes"es, regardless of whether the app is running in RStudio or in a browser (Chrome). There was no error, only the extra logging messages due to cat()

Maybe I am missing something - are there any additional steps you attempted? If so, could you please describe them one a time?

My gut feeling is that there is something not exactly right with your installation of R. At this point, I recommend:

  • restarting the computer (it happened to me too many times)
  • reinstalling R and RStudio, and shiny
    • make sure that you delete the old library first
    • the goal is to
  • try to install and run it on a different machine

Can you run the script "as is" in a new file?
Are there any other packages you are using that might overwrite some of the functions used in the script?

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.