Reputation: 133
I need to have the outputText (Key_facts) as a hyperlink, whenever I extract it from csv file could you please help me to figure out how to solve this issue
library(shiny)
info_360 <- read.csv('data/360_photos.csv')
ui <-
fluidRow(
box(
title = "Key Facts",
closable = FALSE,
width = 9,
status = "primary",
solidHeader = FALSE,
collapsible = TRUE,
textOutput("keyfacts"))
server <- function(input, output,session) {
Keyfactstext <- reactive({
if (input$mySliderText %in% info_360$press )
{
info_360 %>%
filter(press == input$mySliderText)%>%
pull(Key_facts)
**#this contains a text that includes a website link, I need only the link to appear as a hyperlink?????????????????**
}
})
output$keyfacts<- renderText({ Keyfactstext ()})
}
shinyApp(ui = ui, server = server)
Upvotes: 1
Views: 476
Reputation: 181
This might work but I can't test without your file
library(shiny)
info_360 <- read.csv('data/360_photos.csv')
ui <-
fluidRow(
box(
title = "Key Facts",
closable = FALSE,
width = 9,
status = "primary",
solidHeader = FALSE,
collapsible = TRUE,
uiOutput("keyfacts"))
server <- function(input, output,session) {
Keyfactstext <- reactive({
if (input$mySliderText %in% info_360$press )
{
info_360 %>%
filter(press == input$mySliderText)%>%
pull(Key_facts)
**#this contains a text that includes a website link, I need only the link to appear as a hyperlink?????????????????**
}
})
output$keyfacts<- renderUI({
tagList$a(href = Keyfactstext(), "Click me")})
}
shinyApp(ui = ui, server = server)
Upvotes: 3