Shiny

object of type ‘closure’ is not subsettable in R Shiny

一个人想着一个人 提交于 2020-01-25 06:44:33
问题 I would like to add buttons to my DT (one for each row - in first column). When I click on the button it should remove the row from DT. I wrote a code: library(shiny) library(DT) shinyApp( ui <- fluidPage(DT::dataTableOutput("data")), server <- function(input, output) { values <- reactiveValues(data = NULL) values$data <- as.data.frame( cbind(c("a", "d", "b", "c", "e", "f"), c(1463, 159, 54, 52, 52, 220), c(0.7315, 0.0795, 0.027, 0.026, 0.026, 0.11) ) ) shinyInput <- function(FUN, len, id, ..

Shiny + downloadHandler + Openxlsx does not generate a xlsx file

↘锁芯ラ 提交于 2020-01-25 04:47:25
问题 I'm trying to generate a .xlsx file through the Openxlsx package with a reactive name and header inside file (the input variables are "ASL.1" and "Year.1"). The object to be saved in the file is the reactive table "tab_1 ()", that is generated by the app without any problems, but when I try to download it the name that is generated by the browser (Chrome) is not (i.e.) "Tab_1_TOSCANA_2015".xlsx" but "download_tab_1", the outputId of the button "download" associated, and nothing is generated.

Filtering dynamically with checkboxgroupinput in Rshiny

允我心安 提交于 2020-01-25 03:30:14
问题 So I have some data that looks like this: lat long group 40.75482559 -73.84514618 One 40.75759888 -73.84442902 Two 40.75468826 -73.84588623 One 40.82676315 -73.92416382 One 40.82736206 -73.92511749 Two 40.787167 -73.977325 Two 40.82994843 -73.92955017 Two 40.75819016 -73.844841 One 40.82663345 -73.92651367 Two And I'm trying to dynamically display latlong points by their group. In my ui.R code, I have: checkboxGroupInput("group", label = h3("Checkbox group"), choices = list('One' = 1, 'Two' =

Download plot created with grid.draw() as png in downloadHandler Shiny

懵懂的女人 提交于 2020-01-25 02:56:06
问题 I'm having problems downloading a plot created with grid.draw() in the downloadHandler() function in Shiny. Here is a reproducible example of what I want to achieve: library(gtable) library(ggplot2) ui <- shinyUI(fluidPage( titlePanel("Test app"), fluidRow( column(4, wellPanel( downloadButton('download',label="Download plot as png") ) ), column(8, plotOutput("plot") ) ) )) server <- function(input,output){ plotting<- reactive({ data1=data.frame(x=rnorm(50),y=rnorm(50)) data2=data.frame(x=rexp

in shiny deployment, How to fix adminLTE deployment issue?

纵饮孤独 提交于 2020-01-25 02:23:47
问题 I'm trying to deploy my shiny app, it works fine in localhost without any issues but when I try to deploy it, I got errors, here is the log of my app: 2020-01-15T05:42:16.875187+00:00 shinyapps[1659296]: Server version: 1.7.8-7 2020-01-15T05:42:16.875214+00:00 shinyapps[1659296]: LANG: C.UTF-8 2020-01-15T05:42:16.875219+00:00 shinyapps[1659296]: R version: 3.6.0 2020-01-15T05:42:16.875221+00:00 shinyapps[1659296]: shiny version: 1.4.0 2020-01-15T05:42:16.875221+00:00 shinyapps[1659296]:

Reactive subset in ddply for rmarkdown shiny

旧城冷巷雨未停 提交于 2020-01-25 00:34:27
问题 I am trying to calculate and plot % yield of some data based on user definable inputs. I am using rmarkdown and shiny to do this. I keep getting stuck when passing a reactive subset through ddply to count the number of rows in the subset.."invalid (null) left side of assignment". Here is an example data set: --- title: "Yield3" author: "P Downs" date: "Tuesday, May 26, 2015" output: html_document runtime: shiny --- # Create user input for reactive subsetting ```{r echo=FALSE} sliderInput(

connecting two slider inputs in Shiny

我怕爱的太早我们不能终老 提交于 2020-01-24 23:18:27
问题 I'm building a shiny app for the Random Forest. The widgets have to define two parameters: the number of trees, between 1 and 1000 sliderInput("nTree", "Number of trees", min = 1, max = 100, value = 10) a tree to visualise, between 1 and the number of trees (input$nTree) that depends on the first widget sliderInput("iTree", "Tree to visualise", min = 1, max = nTree, value = 10) How can I define nTree inside the second widget? Its value depends on the first widget. Thanks in advance. 回答1: You

connecting two slider inputs in Shiny

南笙酒味 提交于 2020-01-24 23:17:21
问题 I'm building a shiny app for the Random Forest. The widgets have to define two parameters: the number of trees, between 1 and 1000 sliderInput("nTree", "Number of trees", min = 1, max = 100, value = 10) a tree to visualise, between 1 and the number of trees (input$nTree) that depends on the first widget sliderInput("iTree", "Tree to visualise", min = 1, max = nTree, value = 10) How can I define nTree inside the second widget? Its value depends on the first widget. Thanks in advance. 回答1: You

Access javascript objects from R in shiny dashboard

帅比萌擦擦* 提交于 2020-01-24 23:04:15
问题 There are many shiny questions on SO asking how to use an input value in UI. The general answer is to use the updateSelect -family or to use renderUI . I understand that it is basically not possible to access values from the input list ( input$... ) in the UI, since the input list is only passed to the server and therefore not existent in the UI environment. What I do not get my head around is, that there are functions such as conditionalPanel which access the input list in javascript and use

How to replaceData in DT rendered in R shiny using the datatable function

若如初见. 提交于 2020-01-24 22:16:45
问题 I have an R shiny app with a DT datatable that is rendered using the datatable function in order to set various options. I would like to use dataTableProxy and replaceData to update the data in the table, but all the examples I can find assume the DT is rendered directly from the data object, not using the datatable function. The reprex below shows what I would like to do, but replaceData doesn't work in this pattern. How do I do this? Thanks. # based on # https://community.rstudio.com/t