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;
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
add a comment
|
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
add a comment
|
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
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
r shiny shiny-reactivity
asked Mar 28 at 20:19
Jayman McAllisterJayman McAllister
134 bronze badges
134 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
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)
This works! Thank you.
– Jayman McAllister
Mar 29 at 19:07
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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)
This works! Thank you.
– Jayman McAllister
Mar 29 at 19:07
add a comment
|
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)
This works! Thank you.
– Jayman McAllister
Mar 29 at 19:07
add a comment
|
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)
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)
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
add a comment
|
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
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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