Shiny

How to make Shiny reactivity work with SQL database?

﹥>﹥吖頭↗ 提交于 2021-02-04 08:26:53
问题 Alright, I modified the script following @Pork Chop advice: server.R library(shiny) library(DT) library(RMySQL) con <- dbConnect(MySQL(), user="myuser", host="myhost", dbname="mydb") shinyServer(function(input, output) { sqlOutput <- reactive({ sqlInput <- paste0("select * from mydb.mytable", " where value < ", input$value, ";") dbGetQuery(con, sqlInput) }) output$table <- DT::renderDataTable(sqlOutput(), server=TRUE, rownames=FALSE, filter="top", options=list(pageLength=10)) output$download

Cache or pre render leaflet map in shiny app

◇◆丶佛笑我妖孽 提交于 2021-02-03 05:58:50
问题 I am trying to map ~8000 polygons using leaflet and run into performance issues. As I am using the map within a shiny app, I was wondering if its possible to somehow cache or pre-render the map. Note that in my case, I have different layers of polygons that are swapped following this approach. A small MWE would be this: The data can be downloaded from here library(shiny) library(leaflet) library(sf) ## Download Shapefile file <- "plz-gebiete.shp" if (!file.exists(file)) { url <- "https://www

Cache or pre render leaflet map in shiny app

爷,独闯天下 提交于 2021-02-03 05:56:53
问题 I am trying to map ~8000 polygons using leaflet and run into performance issues. As I am using the map within a shiny app, I was wondering if its possible to somehow cache or pre-render the map. Note that in my case, I have different layers of polygons that are swapped following this approach. A small MWE would be this: The data can be downloaded from here library(shiny) library(leaflet) library(sf) ## Download Shapefile file <- "plz-gebiete.shp" if (!file.exists(file)) { url <- "https://www

Cache or pre render leaflet map in shiny app

一笑奈何 提交于 2021-02-03 05:56:04
问题 I am trying to map ~8000 polygons using leaflet and run into performance issues. As I am using the map within a shiny app, I was wondering if its possible to somehow cache or pre-render the map. Note that in my case, I have different layers of polygons that are swapped following this approach. A small MWE would be this: The data can be downloaded from here library(shiny) library(leaflet) library(sf) ## Download Shapefile file <- "plz-gebiete.shp" if (!file.exists(file)) { url <- "https://www

Shiny not displaying ggplot data

最后都变了- 提交于 2021-01-30 09:13:10
问题 I am new to working with shiny package. I am trying to use it to display a ggplot2 graph. I get no errors with my code, however data points are not appearing on the graph. When I select the variables from ui, the axes labels changes accordingly but the data is not added to the plot. Thank you, Code: ui <- fluidPage( sidebarLayout( sidebarPanel( selectInput(inputId = "y", label = "Y-axis:", choices = c("P-value", "P-adjust"), selected = "P-adjust"), selectInput(inputId = "x" , label = "X-axis:

Shiny not displaying ggplot data

China☆狼群 提交于 2021-01-30 09:10:20
问题 I am new to working with shiny package. I am trying to use it to display a ggplot2 graph. I get no errors with my code, however data points are not appearing on the graph. When I select the variables from ui, the axes labels changes accordingly but the data is not added to the plot. Thank you, Code: ui <- fluidPage( sidebarLayout( sidebarPanel( selectInput(inputId = "y", label = "Y-axis:", choices = c("P-value", "P-adjust"), selected = "P-adjust"), selectInput(inputId = "x" , label = "X-axis:

Shiny: How to change the page/window title in Shiny?

自作多情 提交于 2021-01-29 22:57:41
问题 There are numerous posts regarding changing titles of other pieces of Shiny apps, e.g.: Change the title by pressing a shiny button Shiny R Shiny page title and image Shiny App: How to dynamically change box title in server.R? My question is related, but not answered by any of these. I would like to make the <head><title>...</title></head> tag reactive, or at least controllable from within an observeEvent in server.R . The following does not work, since ui can't find theTitle , but is the

Shiny: How to change the page/window title in Shiny?

醉酒当歌 提交于 2021-01-29 22:48:00
问题 There are numerous posts regarding changing titles of other pieces of Shiny apps, e.g.: Change the title by pressing a shiny button Shiny R Shiny page title and image Shiny App: How to dynamically change box title in server.R? My question is related, but not answered by any of these. I would like to make the <head><title>...</title></head> tag reactive, or at least controllable from within an observeEvent in server.R . The following does not work, since ui can't find theTitle , but is the

Conditional css styling in R shiny app on selectizeInput (based on input from colourInput)

两盒软妹~` 提交于 2021-01-29 22:44:01
问题 Following on from this example can anyone please tell me if it's possible to update the colours of my selectizeInput based on input from the colourInput . ## load iris dataset data(iris) cats <- levels(iris$Species) ## colourInput ---- create list of shiny inputs for UI ids <- paste0("col", seq(3)) cols <- c("red", "blue", "yellow") foo <- function(x) {colourInput(ids[x], cats[x], cols[x])} my_input <- lapply(seq(ids), foo) ## css styling for selectizeInput menu CSS <- function(values, colors

Shiny: How to change the page/window title in Shiny?

眉间皱痕 提交于 2021-01-29 22:42:50
问题 There are numerous posts regarding changing titles of other pieces of Shiny apps, e.g.: Change the title by pressing a shiny button Shiny R Shiny page title and image Shiny App: How to dynamically change box title in server.R? My question is related, but not answered by any of these. I would like to make the <head><title>...</title></head> tag reactive, or at least controllable from within an observeEvent in server.R . The following does not work, since ui can't find theTitle , but is the