有没有办法在 pblapply 函数中插入闪亮的进度函数(incProgress),以便它在右上角以百分比显示进度。每次 lapply 函数再次启动时,都需要评估 IncProgress(...),就像在基于文本的进度条中更新控制台一样。
这是我的测试示例:
runApp(list(
ui = shinyUI(
fluidPage(
actionButton("calc","Start calculation"),
dataTableOutput("out")
)
),
server = shinyServer(function(session, input, output) {
library(pbapply)
#create list
n <- 100; nn <- 1000
g <- factor(round(n * runif(n * nn)))
x <- rnorm(n * nn) + sqrt(as.numeric(g))
xg <- split(x, g)
observeEvent(input$calc > 0,{
withProgress(message = "Initializing data manipulation process", value=0, {
list = pblapply(xg,mean)
#insert 'incProgress(percentage, detail = paste0("Progress: ",percentage)' in the pbapply or txtProgress function
})
output$out = renderDataTable(datatable(as.data.frame(unlist(list)))) …Run Code Online (Sandbox Code Playgroud) 是否可以使sliderInput以递减顺序显示值(从左到右;例如5 4 3 2 1)?
runApp(
list(
ui = fluidPage(
sliderInput("test","", min=5, max=1, value = 3, step=1)
),
server = function(input,output) {}
)
)
Run Code Online (Sandbox Code Playgroud) 我一直在寻找一种解决方案,该方法如何使用闪亮的按钮添加和删除输入字段。我没有源代码,因为我没有取得太大进展,但是这个jQuery示例(http://www.mkyong.com/jquery/how-to-add-remove-textbox-dynamically-with-jquery /)可以很好地说明我要完成的工作。这是否有可能在闪亮或我应该使用闪亮js做到这一点?先感谢您!