Shiny

Area select event for R leaflet in shiny

ぐ巨炮叔叔 提交于 2020-01-15 19:12:12
问题 I've played with the mouse click event in leaflet using the following code: mymap=leaflet() selected_site=eventReactive(input$mymap_marker_click,{ event <- input$mymap_map_marker_click return(mydt[Long==event$lng & Lat==event$lat,get("sites")]) }) to display a plot from a data.table after a click on a point of the map. Now, I'd like to select an entire area then display data binding to it. In other terms, I'd like to select not a couple of (Lat,Long) but a series of (Lat1, Long1)....(Latn

Area select event for R leaflet in shiny

柔情痞子 提交于 2020-01-15 19:11:07
问题 I've played with the mouse click event in leaflet using the following code: mymap=leaflet() selected_site=eventReactive(input$mymap_marker_click,{ event <- input$mymap_map_marker_click return(mydt[Long==event$lng & Lat==event$lat,get("sites")]) }) to display a plot from a data.table after a click on a point of the map. Now, I'd like to select an entire area then display data binding to it. In other terms, I'd like to select not a couple of (Lat,Long) but a series of (Lat1, Long1)....(Latn

Conditional initial values in shiny UI?

╄→гoц情女王★ 提交于 2020-01-15 10:15:57
问题 Is there a way to make the initial value of a Shiny UI input conditional? Consider the below example using the Old Faithful Eruptions app example from Shiny's homepage I would like to do something akin to having the individual observations be turned off initially except for when input$n_breaks == 50 ui.R shinyUI(bootstrapPage( selectInput(inputId = "n_breaks", label = "Number of bins in histogram (approximate):", choices = c(10, 20, 35, 50), selected = 20), checkboxInput(inputId = "individual

How to get these shinyApp parameters to be “reactive” to input changes

╄→гoц情女王★ 提交于 2020-01-15 09:24:18
问题 I'm building a simple shinyApp that plots a normal distribution given two quantiles (lbv and ubv) corresponding to 5% and 95% probability (a 90% confidence interval). The quantiles are user-defined inputs. To get the mean and sd of the normal PDF, I'm using get.norm.par() from the rriskDistributions package, like so: dpar <- get.norm.par(p=c(0.05,0.95),q=c(lbv,ubv),plot=F) mean <- dpar[1] sd <- dpar[2] How do I get the shinyApp to react to input changes in the UI? I'm new to Shiny - it seems

How to use different fonts in an R Shiny plot

人走茶凉 提交于 2020-01-15 09:07:01
问题 I would like to create a plot in Shiny that the user can then download as a pdf using a custom font specified as a user input. To be specific, I would like to use a pdf function such as pdf("plot.pdf", width = 5, height = 5, family = font.family) , where the value of font.family is specified by the user. Here is a simple example below: If I run the example on my machine, it works fine. However, when it is hosted on the RStudio shiny servers, I receive an error saying that the specified font

How to use different fonts in an R Shiny plot

女生的网名这么多〃 提交于 2020-01-15 09:03:30
问题 I would like to create a plot in Shiny that the user can then download as a pdf using a custom font specified as a user input. To be specific, I would like to use a pdf function such as pdf("plot.pdf", width = 5, height = 5, family = font.family) , where the value of font.family is specified by the user. Here is a simple example below: If I run the example on my machine, it works fine. However, when it is hosted on the RStudio shiny servers, I receive an error saying that the specified font

R Shiny: how to prevent duplicate plot update with nested selectors?

送分小仙女□ 提交于 2020-01-15 08:37:08
问题 I have a dataset in which every row contains data about single person and every column contains different information about him/her. Let's say it looks like this (but more columns and rows in real data): data <- data.frame( height=runif(1000, 150, 200), sex=sample(c("f","m"), 1000, replace=T), heir=sample(c("blond", "black", "red", "brown"), 1000, replace=T), eye=sample(c("blue", "green", "brown"to show histograms ), 1000, replace=T) ) I want to make a Shiny app in which I could select a

Can't display Leaflet HTML through R-Shiny (404 error). How to integrate KML file with rMaps or leaflet-shiny?

纵然是瞬间 提交于 2020-01-15 07:37:48
问题 I'm having some issues displaying an interactive map in R-Shiny that incorporates a KML file. I installed leaflet-plugins and was able to create an HTML file that displays properly by itself in the browser but not within Shiny. This attempt followed an example here - the code is available if you view source. Because this initial version does not require the HTML itself to change, I attempted to follow the samples here to include the raw HTML in my page but I receive a 404 error with these as

Can't display Leaflet HTML through R-Shiny (404 error). How to integrate KML file with rMaps or leaflet-shiny?

☆樱花仙子☆ 提交于 2020-01-15 07:37:48
问题 I'm having some issues displaying an interactive map in R-Shiny that incorporates a KML file. I installed leaflet-plugins and was able to create an HTML file that displays properly by itself in the browser but not within Shiny. This attempt followed an example here - the code is available if you view source. Because this initial version does not require the HTML itself to change, I attempted to follow the samples here to include the raw HTML in my page but I receive a 404 error with these as

How can I grab the row of data from a ggplotly in shiny

亡梦爱人 提交于 2020-01-15 06:56:33
问题 Code Below. I'm trying to use the plotly_click event to figure out what data is being selected. However, I can't figure out how to do it. The data provided by plotly_click is very minimal and doesn't include the grouping or groups at all. I don't have any JS experience, but I know there must be a way! My goal is to be able to select a data point and be able to grab the row it corresponds to in a data.frame d1 d1=structure(list(Topic = c("compensation", "manager", "benefits", "family",