Shiny

R Shiny: Creating unique datatables for different datasets

我与影子孤独终老i 提交于 2021-01-29 05:51:25
问题 UPDATED: An example of the problem is shown below the code for the app I'm building an dynamic ML app where the user can upload a dataset to get a prediction of the first column in the dataset (the response variable should be located in column 1 of the uploaded dataset). The user can select a value for the variables in the uploaded dataset and get a prediction of the response variable. I'm currently trying to create a datatable that stores all the selected values, timestamp and the prediction

Changing css params of a dropdownButton from shinyWidgets

自闭症网瘾萝莉.ら 提交于 2021-01-29 05:51:03
问题 I have designed a simple dropdownButton from the shinyWidgets package. Somehow I am unable to change the css parameters of the widget. dropdownButton( icon = icon('info'), size = 'sm', right = T, up = F, width = '400px', div('my text', style = 'font-size:10px')) I have tried to follow the css adjustment of the link here shinywidget dropdownButton CSS tag However this only changed the pop-up window's params. I tried to inspect the element and find the css codes but in vain. Ideally I need to

Allow Cross-Origin-Ressource Sharing R-Studio Server/Shiny

大城市里の小女人 提交于 2021-01-29 05:44:35
问题 I am hosting a Shiny App on R-Studio Server. The App created through Shiny is a Browser App. That means JavaScript is executed from the Client site. In my App I create several through user interaction, which are saved on localhost/webserver. I then want to access these files in JavaScript and process them in there. And thats where the trouble starts... This is cross-origin-ressource-sharing and I cannot make a Cross-Origin XMLHttpRequest since this is forbidden due to security reasons. How am

Convert Shiny App R code to Rmarkdown Shiny App code: with observeEvent and eventReactive

亡梦爱人 提交于 2021-01-29 05:42:34
问题 I want to use Shiny Action buttons in rmarkdown file. Can you help please to rewrite the following code (from https://shiny.rstudio.com/articles/action-buttons.html) into RMarkdown? # Codes from https://shiny.rstudio.com/articles/action-buttons.html library(shiny) ui <- fluidPage( # Pattern 1 - Command tags$head(tags$script(src = "message-handler.js")), actionButton("do", "Click Me"), hr(), # Pattern 2 - Delay reactions actionButton("go", "Go"), numericInput("n", "n", 50), plotOutput("plot2")

How can I change R-Shiny “checkboxinput” value to FALSE/TRUE programmatically?

南笙酒味 提交于 2021-01-29 05:30:16
问题 I want to change the checkboxinput value to FALSE/TRUE during run-time. How can I do this? checkboxInput(inputId = "smoother", label = "Overlay smooth trend line", value = FALSE) 回答1: You can use updateCheckboxInput() . See an example below: Reproducible example: library(shiny) ui <- fluidPage( actionButton( inputId = "check", label = "update checkbox" ), checkboxInput( inputId = "checkbox", label = "Input checkbox" ) ) server <- function(input, output, session) { observeEvent( eventExpr =

Select specific row of a datatable with a shiny widget

人走茶凉 提交于 2021-01-29 05:21:17
问题 I have the shiny app below in which the user clicks on a row and gets its index next to it. Is it possible to select the selected row with a pickerInput() which includes all the row names except of the selected one and when activated with a choice it will display the correspondent row and display its index as text. library(shiny) library(DT) library(shinyWidgets) shinyApp( ui = fluidPage( title = 'Select Table Rows', h1('A Server-side Table'), fluidRow( column(9, DT::dataTableOutput('x3')),

How to use shinyFiles package within Shiny Modules - Namespace Issue?

大兔子大兔子 提交于 2021-01-29 03:47:50
问题 I'm having trouble using the "shinyFilesButton()" and "shinyFilesChoose()" functionality within modules in R shiny. I believe my issue is related to the namespace functions ("ns()") that effectively create new, unique ids within the modules. Where do I put the ns() call within the shinyFiles functions? How do I handle this issue on the server side? I've mocked up an example, with code shown below. The app just selects a file and tells you the info on what you selected. Note that currently no

Reactively filtering/subsetting a data frame in shiny

倖福魔咒の 提交于 2021-01-29 02:31:16
问题 I want to filter a data frame such that I only choose rows where a categorical variable contains values chosen by the user of the shiny app. Here is a reproducible example: ## app.R ## library(shiny) library(shinydashboard) library(tidyverse) library(DT) ui <- dashboardPage( dashboardHeader(), dashboardSidebar( selectInput("cut", "Type of cut", c("All",as.character(unique(diamonds$cut))), selected = "All", multiple = TRUE) ), dashboardBody( DT::dataTableOutput("table") ) ) server <- function

How to make the size of icon consistent when using Shiny and Shinydashboard?

ぃ、小莉子 提交于 2021-01-28 21:15:59
问题 I am adding clickable icons in my shiny app to show a popup information box. Please see the following screenshot and code example. My strategy is to wrap my text and the code for actionLink in the HTML function. This works well. However, the size of the icon is determined by the size of the associated. I would like to know if it is possible to make all the icons the same size, such as the smallest one associated with the selectInput ? The documentation (https://shiny.rstudio.com/reference

Can we either print or plot in Shiny in same panel?

◇◆丶佛笑我妖孽 提交于 2021-01-28 20:43:44
问题 I would like to either call output$IPLMatchPlot <- renderPlot({ f(x) }) or output$IPLMatchPrint <- renderPrint({ f(x) }) The function f(x) either returns a plot or a data frame. I am able to do this separately in the server.R but would like to the display to be either a plot or the text of the data frame. Any suggestions of how to do this 回答1: This can be handled by using a renderUI() which checks what kind of output it's getting and renders the appropriate output. In the UI part you would