Skip to content

Trouble with advanced Shiny app used in crew examples #118

Closed Answered by shikokuchuo
wlandau asked this question in Q&A
Discussion options

You must be logged in to vote

The above works perfectly for me as well, both the text in the app as well as the print statements to the console.

The below is an alternative I quickly hacked together using mirai_map() that doesn't use ExtendedTask (note: I don't think it's an issue with ExtendedTask, but possibly the non-standard way it is being used, with the additional observe). It may not be the best way to do things, but minimally modifies your original example.

library(mirai)
library(shiny)

flip_coin <- function(...) {
  Sys.sleep(0.1)
  rbinom(n = 1, size = 1, prob = 0.501)
}

ui <- fluidPage(
  div("Is the coin fair?"),
  actionButton("task", "Flip 1000 coins"),
  textOutput("status"),
  textOutput("outcomes")
)

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
4 replies
@wlandau
Comment options

@shikokuchuo
Comment options

Answer selected by wlandau
@wlandau
Comment options

@shikokuchuo
Comment options

Comment options

You must be logged in to vote
4 replies
@wlandau
Comment options

@shikokuchuo
Comment options

@shikokuchuo
Comment options

@wlandau
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants