How can I display brilliant data as a link

Let's say I have one column data.frame which has a list of urls like

urlCol
http://mysite1.com
http://mysite2.com

      

How do I set this as a clickable link in renderDataTable?

TIA

+3


source to share


1 answer


The URL can be wrapped in an anchor tag:

library(shiny)
runApp(
  list(ui = fluidPage(
    dataTableOutput("myTable")
  )
  , server = function(input, output, session){
    output$myTable <- renderDataTable({
      data.frame(name = c("GOOGLE", "YAHOO")
                 , url = c("<a href=\"http://www.google.com\">http://www.google.com</a>"
                           , "http://yahoo.com")
                           )
    })
  })
)

      



enter image description here

+1


source







All Articles