Shiny

Legend title in plotly

血红的双手。 提交于 2020-01-13 02:44:11
问题 How do I specify title for legend in plotly ? I have a stacked bar graph that plots different durations like 0-10, 11-20. I want the legend title to say 'Duration'. 回答1: The simplest way to specify a legend title is to set it via ggplot and have plotly read it from the corresponding object: library( plotly ) gg <- ggplot( mtcars, aes( x=mpg, y=wt, color=factor(vs) ) ) + geom_point() + labs( color = "MyTitle" ) ggplotly( gg ) However, the problem is that plotly converts the legend title into

Tooltip in shiny UI for help text

百般思念 提交于 2020-01-12 16:11:29
问题 I want to place a help text for check-box label as a tooltip. In the following example I use the shinyBS package - but I only get it to work for the title of the checkbox input group. Any ideas how it could work after the "Lernerfolg" or "Enthusiasmus" labels? library(shiny) library(shinyBS) server <- function(input, output) { output$distPlot <- renderPlot({ hist(rnorm(input$obs), col = 'darkgray', border = 'white') output$rendered <- renderUI({ checkboxGroupInput("qualdim", tags$span(

Tooltip in shiny UI for help text

青春壹個敷衍的年華 提交于 2020-01-12 16:09:35
问题 I want to place a help text for check-box label as a tooltip. In the following example I use the shinyBS package - but I only get it to work for the title of the checkbox input group. Any ideas how it could work after the "Lernerfolg" or "Enthusiasmus" labels? library(shiny) library(shinyBS) server <- function(input, output) { output$distPlot <- renderPlot({ hist(rnorm(input$obs), col = 'darkgray', border = 'white') output$rendered <- renderUI({ checkboxGroupInput("qualdim", tags$span(

Tooltip in shiny UI for help text

吃可爱长大的小学妹 提交于 2020-01-12 16:08:26
问题 I want to place a help text for check-box label as a tooltip. In the following example I use the shinyBS package - but I only get it to work for the title of the checkbox input group. Any ideas how it could work after the "Lernerfolg" or "Enthusiasmus" labels? library(shiny) library(shinyBS) server <- function(input, output) { output$distPlot <- renderPlot({ hist(rnorm(input$obs), col = 'darkgray', border = 'white') output$rendered <- renderUI({ checkboxGroupInput("qualdim", tags$span(

Filtering by date in Shiny

对着背影说爱祢 提交于 2020-01-12 10:54:40
问题 cannot resolve a simple task as a poor Shiny guy. I have a row in a data frame with dates crime.date <- strptime(incidents$REPORT_DAT, format = "%Y-%m-%d") My output for dates looks like this. [1] "2017-04-07 EDT" "2017-03-13 EDT" "2017-01-08 EST" "2017-01-25 EST" "2017- 01-03 EST" "2017-01-03 EST" "2017-01-03 EST" [8] "2017-01-03 EST" "2017-01-03 EST" "2017-01-03 EST" "2017-01-03 EST" "2017- 01-04 EST" "2017-01-03 EST" "2017-01-03 EST" Now I try to visualize the selection of all crimes,

R shiny navbarPage right aligned tabs

前提是你 提交于 2020-01-12 10:49:50
问题 By default, using navbarPage() in shiny creates a 'static top' bootstrap page (example). If I were writing the html for a webpage, I could add a <ul> element with a class of nav navbar-nav navbar-right where the navbar-right would move the tabs/menus to the right side of the navbar. There doesn't seem to be a way to coerce this behavior directly through the framework - is there a clever known way to accomplish this? 回答1: Depends on how low your expectations are. You can add css to your UI

R shiny ask confirmation before closing app/tab

狂风中的少年 提交于 2020-01-12 10:17:29
问题 I want to display a confirmation modal, before the tab/app closes but only if changes really have been made. I found some useful functions here but they show the modal every time I want to close the app/tab. In the example below I use the goodbye -function from @Matee Gojra. I thought I could send a boolean value from R to JavaScript and only execute the function in case a change has been made. But apparently if I include an if-condition in the function it doesn't work anymore. How can I make

call R script from Shiny App

筅森魡賤 提交于 2020-01-12 09:46:25
问题 I developed a shiny app which displays some dynamic charts. These charts are generated at execution time according to the value of some buttons. This shiny app gets the data from a raw csv which is previously treated and transformed. I got a Rscript apart from the shiny app to do all those "transformations" of the raw data. What I would like to do is to call this Rscript from the shiny app in order to be executed when the shiny app is launched. I have already checked these links but it didn't

call R script from Shiny App

强颜欢笑 提交于 2020-01-12 09:45:14
问题 I developed a shiny app which displays some dynamic charts. These charts are generated at execution time according to the value of some buttons. This shiny app gets the data from a raw csv which is previously treated and transformed. I got a Rscript apart from the shiny app to do all those "transformations" of the raw data. What I would like to do is to call this Rscript from the shiny app in order to be executed when the shiny app is launched. I have already checked these links but it didn't

React to menuItem() tab selection

↘锁芯ラ 提交于 2020-01-12 07:30:09
问题 In shinydashboard , one can create menuItem() s, which are tabs in the sidebar. I want to be able to poll which tab is active, by using the standard input$foo syntax. However, I was not able to do so. I tried by referencing the menuItem() 's tabName or id but that did nothing. Is there a way to do it? 回答1: sidebarMenu have optional id parametr you can use it sidebarMenu(id="menu1", menuItem("PointA_",tabName = "PointA") ) On server side use input$menu1 Full working example, print PointA or