天道酬勤,学无止境

shiny

Error: invalid first argument with R Shiny plot

I have written an R script to train myself and others on Shiny, with R. One can select a dataset and plot an 'x' and 'y' variable on a base plot. There are a couple of other user defined arguments also. It all works, however it also kicks 'Error: invalid first argument', which can be seen on the 'Plot' tab (on the shiny dashboard). I have included a 'Submit' button to pause the process down and you can see the error sign clearly, with out the submit button the the error flashes briefly, disappears and then everything works. Additional information in the console suggests it may have something

2022-01-18 21:15:30    分类:问答    r   plot   get   shiny

r: Rendering Kable with Shiny in Flexdashboard

Is there a way to use a render__ function to render a Kable (knitr::) with Shiny in Flexdashboard? I am finding information about general Shiny-Kable rendering, but not specifically with Flexdashboard. Links like this one are helpful but it would be great to be able to call a render_ function to display the Shiny interactive Kable in my Flexdashboard. Any advice would be awesome! Thanks! Stefan

2022-01-18 18:46:44    分类:问答    r   shiny   flexdashboard   kable

Updating selection of server-side selectize input with >1000 choices fails

I have a shiny app containing a server-side selectize input with a long list (>10k) of choices. I would like to update the selection upon clicking a button. Here is a reproducible example library(shiny) ui <- fluidPage( actionButton('buttonid','Button'), selectizeInput("listid", "A long list", choices = NULL) ) server <- function(input, output, session) { updateSelectizeInput(session, "listid", choices = paste("Item", 1:10000), server = T) observeEvent(input$buttonid, { updateSelectizeInput(session, "listid", selected = "Item 1234") }) } shinyApp(ui = ui, server = server) The above code

2022-01-18 15:26:02    分类:问答    r   shiny   selectize.js

R shiny: how to embed a background image in a plot created with rCharts / Highcharts?

I have an R shiny app containing a few Highcharts plots that were created with rCharts package. I would like to include a background image (sourced locally from my hard drive) in one of the plots. I found an example on Highcharts website using plotBackgroundImage option, see jsfiddle example. I adapted it to rCharts, which works great. I was able to source the image via url or locally: require(rCharts) # img_src <- '<path-to-the-folder>/skies.jpg' this works also img_src <- 'https://www.highcharts.com/samples/graphics/skies.jpg' p <- Highcharts$new() p$chart(type='line', plotBackgroundImage

2022-01-18 13:57:26    分类:问答    javascript   r   highcharts   shiny   rcharts

Building multipage shiny application userside (in ui.R) by using navbarPanel() and hiding the navigation bar?

I want to build a multipage shiny application where I can control which page the user can see. Dean Attali does something similiar in this demonstration app, using shinyjs to hide and show each page. I suppose there could also be ways to do this by using navbar(), navlist() or tabsetPanel(), if one can hide the navigation bar or the navigation list. Advantages would be to update pages simply via updateTabsetPanel(), updateNavbarPage() or updateNavlistPabel(), and that shinyjs is not neccesary any more. So my question is: How can I hide the navigation bar of navbarPanel(), for example using CSS

2022-01-18 12:53:39    分类:问答    r   shiny

R Shiny rCharts https server failing to load fonts.googleapis.com

I got a shiny https server running, and I tried to use rCharts to plot a dTable so that I could do multi-column sort from dataTables (see https://stackoverflow.com/a/20956772/719016). What I could deduct from the Console output and this explanation (http://yoast.com/wordpress-ssl-setup/) is that this rCharts table is trying to load fonts from fonts.googleapis.com via the templates/default.html in shiny: [blocked] The page at 'https://my.server.com/shiny/shiny_dev/' was loaded over HTTPS, but ran insecure content from 'http://fonts.googleapis.com/css?family=Source+Code+Pro': this content should

2022-01-18 06:48:32    分类:问答    r   shiny   rcharts   google-apis-explorer

Render sub/superscript in table (shiny)

I have a datatable in a shiny app, in which I want to add superscript to my observations. These should detail whether the observation is an estimate, and how far the year of the observation is from the reference year (this data is already in my dataset). For example a particular observation might display : "75(superscript)-3 e". Is this possible?

2022-01-18 06:18:38    分类:问答    r   shiny   render   subscript   superscript

R Shiny - downloading a csv to the working directory

I’ve got a Shiny app in which I’d like to accomplish the following: 1) User presses a button 2) A data frame gets exported to a .csv, saved in either the working directory (with server.R and ui.R), or ideally one level down. I want this to happen automatically, because eventually I’m going to connect it with a checkboxGroupboxInput to loop through the data and produce a set of filtered .csv. Here is the closest I can currently get, with fileToDownload representing my data frame: ui.R: downloadButton("rptDownload", "Download Report"), server.R: output$rptDownload <- downloadHandler( filename =

2022-01-18 04:47:14    分类:问答    r   download   shiny

Remove "Select All" action button from pickerInput using shinywidgets

I am using shinywidgets pickerinput to create a dropdown for the user to select their country or countries of interest with the code below. I would like to remove the ability to “Select All” i.e. the user should only be able to select a few countries not the entire list (which is 185 countries). I would like “Deselect All” to remain in case a new country comparison is required but selecting all the countries will not work in further downstream code. Is it possible to remove this "Select All" functionality from pickerinput or perhaps an alternative solution that allow multiple selection with

2022-01-18 04:13:39    分类:问答    shiny   shinywidgets   pickerinput

R shiny : checkboxGroupInput value

I'm new to R and I have this code in Ui.R : library(shiny) ui <- shinyUI(fluidPage( titlePanel("Test 1"), sidebarLayout( sidebarPanel( checkboxGroupInput("sex", "sex", c("Men", "Women")), textOutput("number") ), mainPanel( ) ) )) And this code in Server.R : server <- shinyServer(function(session, input, output) { observeEvent(input$sex, { if (input$sex == "Men"){s<-1} number<-as.numeric(s) if (input$sex == "Women"){s<-2} number<-as.numeric(s) if (input$sex == "Men" & input$sex == "Women"){s<-5} number<-as.numeric(s) if (is.null(input$sex)) {s<-10} number<-as.numeric(s) output$number<

2022-01-17 16:15:04    分类:问答    r   shiny