是否可以设置“闪亮”选项以全视图模式(即最大化窗口)自动打开应用程序?
我的用户界面经过精心设计,只有在以全视图浏览时才具有漂亮的外观。
我的源代码写在两个标准文件中:server.R和ui.R。
我对这两个选项都感兴趣:在(1)RStudio窗口和(2)外部浏览器中运行应用程序。
尽管在我看来这是一个自然而简单的问题,但是在搜索网络时我找不到任何建议。有人知道解决方案吗?
关于这个问题已经有类似的帖子了(例如,如何更新闪亮的fileInput对象?),但我仍然无法弄清楚人们如何强制Shiny忘记使用widget input$file之后的值fileInput.
当一个人想要触发上传文件actionButton("Submit"在我的情况下调用)然后用另一个actionButton("Reset"这里)重置其值时,问题变得唠叨.再次单击"提交"按钮时,很明显输入的$ file值仍然存在.
我尝试使用一些推荐的解决方案:shinyjs包装和刷新fileInput模块带renderUI/ uiOutput- 但仍然没有结果.
这是我的代码:
server.R
shinyServer(function(input, output, session) {
values <- reactiveValues(
file = NULL
)
observeEvent(input$submit, {
values$file <- input$file1
})
observeEvent(input$reset, {
values$file <- NULL
output$resettableInput <- renderUI({
fileInput('file1', label = NULL)
})
}, ignoreNULL = F)
output$summary <- renderText({
return(paste('Uploaded file:', values$file$name))
})
})
Run Code Online (Sandbox Code Playgroud)
ui.R
shinyUI(bootstrapPage(
headerPanel('Reset / Submit file input example'), …Run Code Online (Sandbox Code Playgroud) 如何利用 sed 在每三位数字之间插入空格,但前提是数字长度超过 10 位数字,即:
blahaaaaaa goog sdd 234 3242423
ala el 213123123123
1231231313123 i 14124124141411
Run Code Online (Sandbox Code Playgroud)
应该变成:
blahaaaaaa goog sdd 234 3242423
ala el 213 123 123 123
123 123 131 312 3 i 141 241 241 414 11
Run Code Online (Sandbox Code Playgroud)
我可以使用轻松分隔 3 位数字sed 's/[0-9]\{3\}/& /g',但无法将其与数字长度结合起来。