What does it mean when R Shiny app downloadHandler only opens a new tab with new instance of app, no download?
I was facing the same issue and found this solution which worked for me:
library(shiny)
ui = fluidPage(actionButton("Download", "Download"))
server = function(input, output) {
observe({
if (input$Download == TRUE){
filename= paste0(Sys.Date(), "_iris.csv")
write.csv(iris, filename)
}
})
}
shinyApp(ui = ui,
server = server)
Shiny App name in browser tab not correct
As per the titlePanel
function for windowTitle
it simply gets h2
of the whatever it is you have your title named: I suggest you simply add the name for that too:
PlayerFinishingOverview <- div("Player Finishing Overview", style = "color:#D81B60")
PlayerFinishingOverviewWindow <- "Player Finishing Overview"
titlePanel(PlayerFinishingOverview,windowTitle = PlayerFinishingOverviewWindow)
link to open a new tab gets invisible in dashboard in r shiny app
The problem is your color:red
doesn't get applied to your anchor a
tag!
Modified Code:
library(shinydashboard)
dashboardPage(
dashboardHeader(title = "flex_logo",
tags$li(class = "dropdown",
tags$a("Help",target="_blank",href="Flex-Forecasting_Usage_Guidelines.pdf",
style="font-weight: bold;color:red;"))
),
dashboardSidebar(
radioButtons("filetype", "Select file type",choices=c("csv file","xlsx file"))
),
dashboardBody()
)
Shiny app - after clicking on new tab, the tab remains selected by browser
You can remove the dotted lines after tab selection by adding some CSS:
library(shiny)
runApp(list(ui = fluidPage(
titlePanel("Tabsets"),
sidebarLayout(
sidebarPanel(
radioButtons("dist", "Distribution type:",
c("Normal" = "norm",
"Uniform" = "unif",
"Log-normal" = "lnorm",
"Exponential" = "exp")),
br(),
sliderInput("n",
"Number of observations:", value = 500,
min = 1, max = 1000)
),
mainPanel(
tabsetPanel(type = "tabs",
tabPanel("Plot", plotOutput("plot")),
tabPanel("Summary", verbatimTextOutput("summary")),
tabPanel("Table", tableOutput("table"))
)
)
)
, tags$head(tags$style(
HTML(
".nav-tabs > .active > a, .nav-tabs > .active > a:hover { outline: 0;}")
))
)
, server = function(input, output) {
data <- reactive({
dist <- switch(input$dist, norm = rnorm, unif = runif,
lnorm = rlnorm, exp = rexp, rnorm)
dist(input$n)
})
output$plot <- renderPlot({
dist <- input$dist
n <- input$n
hist(data(), main=paste('r', dist, '(', n, ')', sep=''))
})
output$summary <- renderPrint({summary(data())})
output$table <- renderTable({data.frame(x=data())})
})
)
So here
tags$head(tags$style(
HTML(
".nav-tabs > .active > a, .nav-tabs > .active > a:hover { outline: 0;}")
))
sets the outline
attribute to 0 on the relevant quantities.
how to open a link in shiny
I guess you just wanted a resizable browser tab popup, for this you edit the JS
and add resizable
argument:
library(shiny)
ui <- fluidPage(shiny::fluidRow(shiny::actionButton(inputId='ab1',
label="click here", value = "Open popup",onclick ="window.open('http://google.com','_blank','resizable,height=260,width=370')")))
server <- function(input, output) {}
shinyApp(ui, server)
Related Topics
Test for Na and Select Values Based on Result
Dealing with Readlines() Function in R
%>% Key Binding/Keyboard Shortcut in Rstudio
Alternate Geom_Text Position with Hjust
How to Put a Box and Its Label in the Same Row? (Shiny Package)
Why Is the Class of a Vector the Class of the Elements of the Vector and Not Vector Itself
Tm: Read in Data Frame, Keep Text Id'S, Construct Dtm and Join to Other Dataset
Using Mean with .Sd and .Sdcols in Data.Table
Converting R Matrix into Latex Matrix in the Math or Equation Environment
How to Make Discrete Gradient Color Bar with Geom_Contour_Filled
Collapse Consecutive Runs of Numbers to a String of Ranges
Extracting Coefficients and Their Standard Error for Each Unit in an Lme Model Fit
How to Count Occurrences Combinations in Data.Table in R
Join Matching Columns in a Data.Frame or Data.Table
Getting Both Column Counts and Proportions in the Same Table in R
Igraph Axes Xlim Ylim Plot Incorrectly