renderImage
isn't working when trying to render an image from the internet. It works when the image is on the local machine.
output$myImage <- renderImage({
pfad <- "https://www.rstudio.com/wp-content/uploads/2014/03/blue-125.png"
list(src = pfad,
contentType = 'image/png',
width = 400,
height = 300,
alt = "This is alternate text")
}, deleteFile = F)
imageOutput("myImage")
You can use tags$img
directly in the ui or in a reactive context :
library("shiny")
ui <- fluidPage(
fluidRow(
column(
6,
tags$img(src = "https://www.rstudio.com/wp-content/uploads/2014/03/blue-125.png")
),
column(
6,
uiOutput(outputId = "image")
)
)
)
server <- function(input, output) {
output$image <- renderUI({
tags$img(src = "https://www.rstudio.com/wp-content/uploads/2014/03/blue-125.png")
})
}
shinyApp(ui = ui, server = server)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With