Shiny

How to place an image in an R Shiny title

喜欢而已 提交于 2020-01-01 09:04:18
问题 So I am using R Shiny and I want to place an image to the right of the text in the title. I can seem to place the image anywhere in the application with the exception of next to the title. Can you not place images in the titlePanel() function? Here is a snippet of the code that I am using: library(shiny) # Define UI for random distribution application shinyUI(fluidPage(#theme="bootstrap.css", # Application title titlePanel("My Title",img(src = "picture.jpg", height = 50, width = 100)),

How do I add a link to open a pdf file in a new window from my R shiny app?

£可爱£侵袭症+ 提交于 2020-01-01 08:52:40
问题 I can use a() to add a hyperlink in to an external site from my Shiny app, a("google",href="http://www.google.com") but how do I make a link to open a pdf (or similar) file? Seems like it should be simple, but I can't find any examples. My question is similar to this one: Add link to R Shiny Application so link opens in a new browser tab but I don't know how to structure the href part- where do I put the file to be opened and how do I specify its location? I've tried simple things like http:/

“read_excel” in a Shiny app

泄露秘密 提交于 2020-01-01 07:58:08
问题 I have a Shiny app that uses the read.xlsx function from package xlsx . All works fine, but I want to change to read_excel from readxl , hoping it would be faster and able to cope with large files. ui part: fileInput("inputFile","Upload file...") server part: data <- reactive({ inFile <- input$inputFile if (is.null(inFile)) { return(NULL) } dataFile <- read_excel(inFile$datapath,sheet=1) return(dataFile) }) I get the "Unknown format" error. inFile$datapath is "/tmp/...

Shiny: Label position, textInput

夙愿已清 提交于 2020-01-01 07:01:10
问题 Lets assume I have a very simple application that only has 8 inputs grouped in 2 Panels (4 inputs | 4 inputs - see picture bellow) and based on these, I plot a small plot (easy peasy). The problem that I face is that I want to have the labels only for the first panel, and on the left of the textInput box. e.g. (Please excuse my sloppy image editing!) Any suggestion? My MWE for Figure 1 output: library(shiny) ui<-shinyUI(fluidPage( wellPanel( tags$style(type="text/css", '#leftPanel { max-width

Externally link to specific tabPanel in Shiny App

爷,独闯天下 提交于 2020-01-01 06:40:47
问题 It's possible to use anchor links in flat Shiny apps relatively easily - https://stackoverflow.com/a/28605517/1659890. However, is it possible for an external link to target a specific tabPanel of a navbarPage in a Shiny app? Consider the following test app: UI: shinyUI(navbarPage( "Anchor Test", tabPanel( "Panel 1", fluidPage(HTML( paste( "<p>I'm the first panel</p>","<p><a href='#irisPlotUI'>Link to irisPlotUI in panel 2</a></p>", "<a href='#panel2'>Link to panel 2</a>",sep = "" ) )) ),

Externally link to specific tabPanel in Shiny App

杀马特。学长 韩版系。学妹 提交于 2020-01-01 06:40:33
问题 It's possible to use anchor links in flat Shiny apps relatively easily - https://stackoverflow.com/a/28605517/1659890. However, is it possible for an external link to target a specific tabPanel of a navbarPage in a Shiny app? Consider the following test app: UI: shinyUI(navbarPage( "Anchor Test", tabPanel( "Panel 1", fluidPage(HTML( paste( "<p>I'm the first panel</p>","<p><a href='#irisPlotUI'>Link to irisPlotUI in panel 2</a></p>", "<a href='#panel2'>Link to panel 2</a>",sep = "" ) )) ),

R Shiny Make slider value dynamic

白昼怎懂夜的黑 提交于 2020-01-01 05:09:08
问题 I've got a dropdown selector and a slider scale. I want to render a plot with the drop down selector being the source of data. - I've got this part working I simply want the slider's max value to change based on which dataset is selected. Any suggestions? server.R library(shiny) shinyServer(function(input, output) { source("profile_plot.R") load("test.Rdata") output$distPlot <- renderPlot({ if(input$selection == "raw") { plot_data <- as.matrix(obatch[1:input$probes,1:36]) } else if(input

Redirect in Shiny app

删除回忆录丶 提交于 2020-01-01 04:47:06
问题 I'm trying to make my Shiny app to redirect the user to another page. I'm using httr to send GET requests and see if the user is logged in. If he's not, I want to redirect him to another link. Can I do that using R / Shiny only, or do I need some extra libraries? sample: library(httr) library(shiny) shinyServer(function(input, output) { rv <- reactiveValues() rv$mytoken = session$request$token observeEvent(input$button1, { rv$a <- GET("my.url:3405/authtoken", add_headers( .headers = c("token"

How to keep a forceNetwork {networkD3} centered in a Shiny app?

徘徊边缘 提交于 2020-01-01 03:31:28
问题 While building a Shiny app that displays a forceNetwork graph, the network does not stay centered but moves out of view when one interactively changes the opacity. My question is, how to change this behavior and keep the network nicely centered as it was initially? A reproducible example: ui.R: library(shiny) library(networkD3) shinyUI(fluidPage( titlePanel("ForceNetD3"), sidebarLayout( sidebarPanel( sliderInput("opacity", "Opacity", min = 0.1, max = 1, value = 0.4) ), mainPanel(

How to keep a forceNetwork {networkD3} centered in a Shiny app?

旧城冷巷雨未停 提交于 2020-01-01 03:31:09
问题 While building a Shiny app that displays a forceNetwork graph, the network does not stay centered but moves out of view when one interactively changes the opacity. My question is, how to change this behavior and keep the network nicely centered as it was initially? A reproducible example: ui.R: library(shiny) library(networkD3) shinyUI(fluidPage( titlePanel("ForceNetD3"), sidebarLayout( sidebarPanel( sliderInput("opacity", "Opacity", min = 0.1, max = 1, value = 0.4) ), mainPanel(