Shiny

R Shiny - Pre-selection of rows in Select extension for Datatables

ε祈祈猫儿з 提交于 2021-02-11 18:08:05
问题 How can I pre-select rows with the Select extension for Datatables in Shiny? I've checked the documentation here: https://datatables.net/extensions/select/. But I can't figure it out. I tried specifying rows = 1:3 but that didn't have any effect: library(DT) library(shiny) dat <- iris[1:17,] shinyApp( ui = fluidPage(DTOutput("table")), server = function(input, output, session) { output[["table"]] <- renderDT({ datatable( dat, options = list(select = list( style = "multi", rows = 1:3, selector

R Shiny - Pre-selection of rows in Select extension for Datatables

做~自己de王妃 提交于 2021-02-11 18:06:15
问题 How can I pre-select rows with the Select extension for Datatables in Shiny? I've checked the documentation here: https://datatables.net/extensions/select/. But I can't figure it out. I tried specifying rows = 1:3 but that didn't have any effect: library(DT) library(shiny) dat <- iris[1:17,] shinyApp( ui = fluidPage(DTOutput("table")), server = function(input, output, session) { output[["table"]] <- renderDT({ datatable( dat, options = list(select = list( style = "multi", rows = 1:3, selector

Perform multiple linear regression with variables based on shiny widget selection

拥有回忆 提交于 2021-02-11 17:57:14
问题 I would like to perform multiple linear regression in a shiny app but every time I would like to change dependent and independent variables based on 2 shiny widgets. Could this be achieved? library(shiny) library(shinydashboard) library(shinydashboardPlus) library(shinyWidgets) library(dplyr) shinyApp( ui = dashboardPagePlus( header = dashboardHeaderPlus(title = "Social Media Metrics", titleWidth = 320 ), sidebar = dashboardSidebar(width = 320, uiOutput("value"), uiOutput("value2") ), body =

Replicating identical tabs and layouts over and over

泄露秘密 提交于 2021-02-11 17:06:04
问题 I am creating an app in which several inputs are displayed in a tab. I would like the user to be able to generate an identical tab (with the same layout) by clicking on a tab dedicated to it (it will be clearer with the example). Therefore, one user could potentially create an infinite number of identical tabs. However, the name given to the inputs should change slightly (e.g. select1 , select2 , etc.) so that these newly created inputs can be used in a reactive way. Moreover, the tabs should

Datatable displays empy selectInput while values are selected by default

删除回忆录丶 提交于 2021-02-11 15:43:39
问题 I have the shiny app below in which I pass the values of a list with characters inside a selectImput() but while all those values seem to be selected (and they should be) by checking their count in the third column the selectize inputs seem to be empty. I think that for this issue is responsible the list words I created. library(shiny) library(DT) library(jsonlite) selector <- function(id, values, items = values){ options <- HTML(paste0(mapply( function(value, item){ as.character(tags$option

R Shiny: display elapsed time while function is running

早过忘川 提交于 2021-02-11 15:40:30
问题 Taking the same idea of this post: R shiny: display "loading..." message while function is running I'd like actually not only display a "loading" message, but also display the elapsed time of the run. And at the end, that the final running time remains displayed. I adapt a MWE from the R-bloggers https://www.r-bloggers.com/long-running-tasks-with-shiny-challenges-and-solutions/ library(shiny) ui <- fluidPage( # Sidebar with a slider input for number of bins sidebarLayout( sidebarPanel(

How can I reactively update the active menuItem in a Shiny app using `renderUI`?

此生再无相见时 提交于 2021-02-11 15:19:09
问题 I am building a shiny app that dynamically creates reactive bs4Box elements from a data frame. I want to make those boxes clickable by the user so that automatic redirection to a different menuItem occurs. I have read and followed similar previous SO questions like this one or this issue without success. A JavaScript solution like this one could also work? Here's my attempt so far using the updatebs4ControlbarMenu function: library(shiny) #> Warning: package 'shiny' was built under R version

downloadButton to download multiple renderPlot reactive in shiny server

跟風遠走 提交于 2021-02-11 14:57:30
问题 I am creating a shiny application that displays several graphics. And I will like through a button download, download all graphs display I do the following: server = function(input, output) { df<-data.frame(q=c(1,3,5,7,9),w=c(2,4,6,8,10),z=c(1,2,3,4,5)) # output all plot output$p1 <- renderPlot({ ggplot(df,aes(x=q,y=w)) + geom_point() }) output$p2 <- renderPlot({ ggplot(df,aes(x=z,y=w))+geom_point() }) output$p3 <- renderPlot({ ggplot(df,aes(x=q,y=z))+geom_point() }) # Here is my function to

Using values from slider in javascript DataTables calculations

隐身守侯 提交于 2021-02-11 14:39:45
问题 I've got a nested DataTable in my shiny app that is made from the data below. There are two sliders that I have which make up a percentage of 100. If one slider is 50 the other sider is 50. These two numbers from the two sliders help make up the Spot:30(%) and the Spot:15(%) columns of the child table. There is another column, Mix(%) , where the user is able to go in and edit the numbers. When the user edits this column the numbers in the Spot:30(%) and the Spot:15(%) columns are suppose to

Change the title by pressing a shiny button Shiny R

一世执手 提交于 2021-02-11 14:22:47
问题 library(shiny) ui <- fluidPage( h1("Free",align = "center"), actionButton("go", "Go") ) server <- function(input, output) { observeEvent(input$go,{ #change the h1 title for code("Busy",align="center") } } shinyApp(ui, server) How to change the title when pressing a button? the idea is to change the word free to busy when the button is pressed. 回答1: Would make the h1 header using uiOutput in the ui . Then, you can dynamically change this text to whatever you want in server . Perhaps for your