Shiny

How to extract element name, not value, from a list in R Shiny selectInput()?

只愿长相守 提交于 2020-07-10 10:28:10
问题 I would like to extract the element name, and not the specific value, from a list used for the choices argument in selectInput() from R Shiny. The selectInput function looks like this: # ... selectInput("xvar", "What is the predictor variable?", choices = list("MPG" = "mpg", "Cylinders" = "cyl", "Engine Displacement" = "disp", "Horse Power" = "hp", "Gears" = "gear"), # ... In my server.R code I would like to use, for example, "Cylinders" and not "cyl" as an axis label. For example (using

R/Rshiny adding item to list of factors

◇◆丶佛笑我妖孽 提交于 2020-07-10 10:24:41
问题 Why is this so difficult?! I have (what I believe is a factor vector) and I want to add an item to the list so I can use it farther down the road. I want to add "memo.txt" to the factor vector filenames. I have figured out how to add a factor level to the list, but not the item itself. levels(filenames) <- c(levels(filenames), "memo.txt") The specific section I am working in is here: observeEvent(input$download, { filenames <- na.omit(data[input$tbl1_rows_selected, "file_name"]) #I need to

Appears condition panel only when a correct file is loaded

丶灬走出姿态 提交于 2020-07-10 03:14:46
问题 Even though the file has problems and is loaded in fileInput my condition panel is being shown, as shown in the Figure. However, I would like this panel to be shown only when the correct file is loaded. Can someone help me ?? The executable code is below: I believe you need to adjust something in the Modelcl of the server. Thank you so much! library(shiny) library(shinyWidgets) library(ggplot2) library(shinythemes) library(rdist) library(openxlsx) library(geosphere) library(rgdal) function.cl

Appears condition panel only when a correct file is loaded

六眼飞鱼酱① 提交于 2020-07-10 03:13:49
问题 Even though the file has problems and is loaded in fileInput my condition panel is being shown, as shown in the Figure. However, I would like this panel to be shown only when the correct file is loaded. Can someone help me ?? The executable code is below: I believe you need to adjust something in the Modelcl of the server. Thank you so much! library(shiny) library(shinyWidgets) library(ggplot2) library(shinythemes) library(rdist) library(openxlsx) library(geosphere) library(rgdal) function.cl

Appears condition panel only when a correct file is loaded

强颜欢笑 提交于 2020-07-10 03:13:44
问题 Even though the file has problems and is loaded in fileInput my condition panel is being shown, as shown in the Figure. However, I would like this panel to be shown only when the correct file is loaded. Can someone help me ?? The executable code is below: I believe you need to adjust something in the Modelcl of the server. Thank you so much! library(shiny) library(shinyWidgets) library(ggplot2) library(shinythemes) library(rdist) library(openxlsx) library(geosphere) library(rgdal) function.cl

Use a custom font within shinyapps.io?

删除回忆录丶 提交于 2020-07-10 03:12:49
问题 I have the following code (placed at the top of my app.R file, just after my library() calls): dir.create('r-lib') download.file('https://cran.r-project.org/src/contrib/extrafontdb_1.0.tar.gz','r-lib/extrafontdb_1.0.tar.gz') .libPaths(c('r-lib', .libPaths())) install.packages('r-lib/extrafontdb_1.0.tar.gz',type = 'source',repos = NULL) dir.create('~/.fonts') download.file("https://github.com/** GIT USER NAME **/fonts/archive/master/fonts.zip", destfile = "fonts.zip") unzip("fonts.zip", exdir

Generate scatterplot both by shapefile and excel in Shiny

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-09 14:28:06
问题 The codes below are working normally, the first code is generating a scatterplot by Shapefile and the second code is generating via Excel, both via fileInput. For simulation the data can be obtained through the following website: https://github.com/JovaniSouza/JovaniSouza5/blob/master/shapefile.rar (shapefile) https://github.com/JovaniSouza/JovaniSouza5/blob/master/Example.xlsx (excel) The problem I am having is that I am not able to unify these codes, since I want to have only one code to

Insert warning message in Shiny

眉间皱痕 提交于 2020-07-09 12:03:48
问题 I would like to insert a alert message when the file inserted in fileInput was different from ".xlsx", ".shp", ".shx", ".dbf". Can you help me? I entered an executable code below. You can even see it in my observeEvent (input$data, which I inserted something similar, but I would like it to be presented as a text box in Shiny. Thank you! library(shiny) library(ggplot2) library(shinythemes) library(rdist) library(openxlsx) library(geosphere) library(rgdal) function.cl<-function(df,k){ } ui <-

Get value from cell in Shiny DataTable

此生再无相见时 提交于 2020-07-09 11:54:51
问题 I have this DataTable in Shiny and I would like to get the value from the first column in a variable textbox when I click an row. So in this case as seen in the screenshot, when I click this row, I would like to get Factuur Factuur in the place where now is Error: object of type 'closure' is not subsettable . I managed to get the row number: UI: p(verbatimTextOutput('chauffeurdetails')) Server: output$chauffeurdetails = renderText ({ chauffeurdetail = input$results_rows_selected }) Anyone

Adjust image that is shown by showModal on Shiny

[亡魂溺海] 提交于 2020-07-09 05:48:10
问题 I would like assistance with two brief questions involving my shiny application. My executable app below is generating an initial message through showModal. However, as you can see the attached image, the logo was disproportionate to the message box, could you help me to solve this ?? I also insert the .html file that I made to show the initial message. In addition, if possible, I would like to activate my button that I called "ok", so that the message comes out, and the user can continue