Issue updating render text from within a loopUpdate plot within observer loop in shiny applicationUpdate shiny output within loopR Shiny: The for loop output available for many render*() functionsR get value from selectInput updatedShiny button within nested module not showing up; namespace issue?Rendering 2 outputs from 1 reactive scriptUpdate data from table database SQL Server through Shiny appHow to update a character vector from shiny textInput?

Can I pay some of the cost of an activated ability lots of times to get more out of the effect?

How to identify whether a publisher is genuine or not?

Is it possible to take a database offline when doing a backup using an SQL job?

disable all sound permanently?

Why most footers have a background color has a divider of section?

Phonetic distortion when words are borrowed among languages

Beyond Futuristic Technology for an Alien Warship?

Can an energy drink or chocolate before an exam be useful ? What sort of other edible goods be helpful?

Sci-fi movie with one survivor and an organism(?) recreating his memories

Diminished data rate with logic output optoisolator

Verb ending in -ん with positive meaning?

Booting Ubuntu from USB drive on MSI motherboard -- EVERYTHING fails

How big would the ice ball have to be to deliver all the water at once?

Incomplete iffalse: How to shift a scope in polar coordinate?

What are one's options when facing religious discrimination at the airport?

Replacing cord for IBM model M keyboard

How does Monks' Improved Unarmored Movement work out of combat?

What action is recommended if your accommodation refuses to let you leave without paying additional fees?

Was the ruling that prorogation was unlawful only possible because of the creation of a separate supreme court?

A word that refers to saying something in an attempt to anger or embarrass someone into doing something that they don’t want to do?

How to stop the death waves in my city?

The differences amongst f[x_], f[x__], and f[x___]

If someone asks a question using “quién”, how can one shortly respond?

How do we know neutrons have no charge?



Issue updating render text from within a loop


Update plot within observer loop in shiny applicationUpdate shiny output within loopR Shiny: The for loop output available for many render*() functionsR get value from selectInput updatedShiny button within nested module not showing up; namespace issue?Rendering 2 outputs from 1 reactive scriptUpdate data from table database SQL Server through Shiny appHow to update a character vector from shiny textInput?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am trying to figure out how to cause rendertext to update for each iteration through a loop. I am trying to create a status bar where some text is output for each cycle through the loop. Currently the text is displayed only after the loop has completed, displaying the last value from the list. The updateprogressbar works completely fine.



Any suggestions?



A minimal reproducible can be found below.



library(shiny)
library(shinyWidgets)

ui <- fluidPage(
tags$h4(textOutput("loadingtxt")),
progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
)

server <- function(input, output, session)

observeEvent(session,

messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)


for (i in 1:10)
Sys.sleep(0.7)
status <- messages[i,]
status
output$loadingtxt <- renderText(status)
updateProgressBar(session = session, id = "pbmod", value = 100/10*i)

)


shinyApp(ui, server)









share|improve this question






























    0















    I am trying to figure out how to cause rendertext to update for each iteration through a loop. I am trying to create a status bar where some text is output for each cycle through the loop. Currently the text is displayed only after the loop has completed, displaying the last value from the list. The updateprogressbar works completely fine.



    Any suggestions?



    A minimal reproducible can be found below.



    library(shiny)
    library(shinyWidgets)

    ui <- fluidPage(
    tags$h4(textOutput("loadingtxt")),
    progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
    )

    server <- function(input, output, session)

    observeEvent(session,

    messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)


    for (i in 1:10)
    Sys.sleep(0.7)
    status <- messages[i,]
    status
    output$loadingtxt <- renderText(status)
    updateProgressBar(session = session, id = "pbmod", value = 100/10*i)

    )


    shinyApp(ui, server)









    share|improve this question


























      0












      0








      0








      I am trying to figure out how to cause rendertext to update for each iteration through a loop. I am trying to create a status bar where some text is output for each cycle through the loop. Currently the text is displayed only after the loop has completed, displaying the last value from the list. The updateprogressbar works completely fine.



      Any suggestions?



      A minimal reproducible can be found below.



      library(shiny)
      library(shinyWidgets)

      ui <- fluidPage(
      tags$h4(textOutput("loadingtxt")),
      progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
      )

      server <- function(input, output, session)

      observeEvent(session,

      messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)


      for (i in 1:10)
      Sys.sleep(0.7)
      status <- messages[i,]
      status
      output$loadingtxt <- renderText(status)
      updateProgressBar(session = session, id = "pbmod", value = 100/10*i)

      )


      shinyApp(ui, server)









      share|improve this question














      I am trying to figure out how to cause rendertext to update for each iteration through a loop. I am trying to create a status bar where some text is output for each cycle through the loop. Currently the text is displayed only after the loop has completed, displaying the last value from the list. The updateprogressbar works completely fine.



      Any suggestions?



      A minimal reproducible can be found below.



      library(shiny)
      library(shinyWidgets)

      ui <- fluidPage(
      tags$h4(textOutput("loadingtxt")),
      progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
      )

      server <- function(input, output, session)

      observeEvent(session,

      messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)


      for (i in 1:10)
      Sys.sleep(0.7)
      status <- messages[i,]
      status
      output$loadingtxt <- renderText(status)
      updateProgressBar(session = session, id = "pbmod", value = 100/10*i)

      )


      shinyApp(ui, server)






      r shiny shiny-reactivity






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 20:19









      Jayman McAllisterJayman McAllister

      134 bronze badges




      134 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          1
















          Here is an option.



          library(shiny)
          library(shinyWidgets)

          ui <- fluidPage(
          tags$h4(textOutput("loadingtxt")),
          progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
          )

          server <- function(input, output, session)

          messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)

          status <- reactiveVal()
          step <- reactiveVal()

          autoInvalidate <- reactiveTimer(700)

          i <- 0
          observe(
          autoInvalidate()
          i <<- i+1
          if(i == 9) # stop the reactive timer
          autoInvalidate <<- reactiveTimer(Inf)

          step(i)
          status(messages[i,])
          )

          output$loadingtxt <- renderText(
          updateProgressBar(session = session, id = "pbmod", value = 100/10*step())
          status()
          )


          shinyApp(ui, server)


          enter image description here






          share|improve this answer

























          • This works! Thank you.

            – Jayman McAllister
            Mar 29 at 19:07













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406226%2fissue-updating-render-text-from-within-a-loop%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1
















          Here is an option.



          library(shiny)
          library(shinyWidgets)

          ui <- fluidPage(
          tags$h4(textOutput("loadingtxt")),
          progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
          )

          server <- function(input, output, session)

          messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)

          status <- reactiveVal()
          step <- reactiveVal()

          autoInvalidate <- reactiveTimer(700)

          i <- 0
          observe(
          autoInvalidate()
          i <<- i+1
          if(i == 9) # stop the reactive timer
          autoInvalidate <<- reactiveTimer(Inf)

          step(i)
          status(messages[i,])
          )

          output$loadingtxt <- renderText(
          updateProgressBar(session = session, id = "pbmod", value = 100/10*step())
          status()
          )


          shinyApp(ui, server)


          enter image description here






          share|improve this answer

























          • This works! Thank you.

            – Jayman McAllister
            Mar 29 at 19:07















          1
















          Here is an option.



          library(shiny)
          library(shinyWidgets)

          ui <- fluidPage(
          tags$h4(textOutput("loadingtxt")),
          progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
          )

          server <- function(input, output, session)

          messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)

          status <- reactiveVal()
          step <- reactiveVal()

          autoInvalidate <- reactiveTimer(700)

          i <- 0
          observe(
          autoInvalidate()
          i <<- i+1
          if(i == 9) # stop the reactive timer
          autoInvalidate <<- reactiveTimer(Inf)

          step(i)
          status(messages[i,])
          )

          output$loadingtxt <- renderText(
          updateProgressBar(session = session, id = "pbmod", value = 100/10*step())
          status()
          )


          shinyApp(ui, server)


          enter image description here






          share|improve this answer

























          • This works! Thank you.

            – Jayman McAllister
            Mar 29 at 19:07













          1














          1










          1









          Here is an option.



          library(shiny)
          library(shinyWidgets)

          ui <- fluidPage(
          tags$h4(textOutput("loadingtxt")),
          progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
          )

          server <- function(input, output, session)

          messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)

          status <- reactiveVal()
          step <- reactiveVal()

          autoInvalidate <- reactiveTimer(700)

          i <- 0
          observe(
          autoInvalidate()
          i <<- i+1
          if(i == 9) # stop the reactive timer
          autoInvalidate <<- reactiveTimer(Inf)

          step(i)
          status(messages[i,])
          )

          output$loadingtxt <- renderText(
          updateProgressBar(session = session, id = "pbmod", value = 100/10*step())
          status()
          )


          shinyApp(ui, server)


          enter image description here






          share|improve this answer













          Here is an option.



          library(shiny)
          library(shinyWidgets)

          ui <- fluidPage(
          tags$h4(textOutput("loadingtxt")),
          progressBar(id = "pbmod", value = 0, display_pct = TRUE, striped = TRUE)
          )

          server <- function(input, output, session)

          messages <- data.frame(c("Loading Environment...", "Parsing data...", "Preparing Live Data Feeds...", "Pondering what to display next...", "Calculating Llama Expectoration Trajectory...", "Breeding Fauna...", "Charging Ozone Layer...", "Compressing Fish Files...", "Speculating Stock Market Indices...", "Application Ready!"), stringsAsFactors = FALSE)

          status <- reactiveVal()
          step <- reactiveVal()

          autoInvalidate <- reactiveTimer(700)

          i <- 0
          observe(
          autoInvalidate()
          i <<- i+1
          if(i == 9) # stop the reactive timer
          autoInvalidate <<- reactiveTimer(Inf)

          step(i)
          status(messages[i,])
          )

          output$loadingtxt <- renderText(
          updateProgressBar(session = session, id = "pbmod", value = 100/10*step())
          status()
          )


          shinyApp(ui, server)


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 29 at 9:50









          Stéphane LaurentStéphane Laurent

          22.6k9 gold badges59 silver badges110 bronze badges




          22.6k9 gold badges59 silver badges110 bronze badges















          • This works! Thank you.

            – Jayman McAllister
            Mar 29 at 19:07

















          • This works! Thank you.

            – Jayman McAllister
            Mar 29 at 19:07
















          This works! Thank you.

          – Jayman McAllister
          Mar 29 at 19:07





          This works! Thank you.

          – Jayman McAllister
          Mar 29 at 19:07




















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406226%2fissue-updating-render-text-from-within-a-loop%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript