You can use renderUI
to dynamically render HTML:
library(shiny)
runApp(
list(ui = fluidPage(
selectInput('website', 'Choose a website'
, list(bbc = "http://www.bbc.co.uk"
, google = "http://www.google.com"
, cnn = "http://www.cnn.com")
)
, htmlOutput("mySite")
)
,server = function(input, output, session){
output$mySite <- renderUI({
tags$a(href = input$website, input$website)
})
})
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…