My code:
library(shiny) runApp( list(ui = fluidPage( uiOutput("tab") ), server = function(input, output, session){ url <- a("Google Homepage", href="https://www.google.com/") output$tab <- renderUI({ paste("URL link:", url) }) }) )
Current output:
URL link: <a href="https://www.google.com/">Google Homepage</a>
Desired output:
URL link: Google Homepage
where Google Homepage
is a clickable hyperlink.
I'm currently using the renderUI
/uiOutput
duo as instructed here: how to create a hyperlink interactively in shiny app?
Hyperlinks are created using the syntax [text](link) , e.g., [RStudio](https://www.rstudio.com) . The syntax for images is similar: just add an exclamation mark, e.g., ![ alt text or image title](path/to/image) . Footnotes are put inside the square brackets after a caret ^[] , e.g., ^[This is a footnote.] .
Along with Shiny elements, you can use HTML elements to stylize your content in your application. In my opinion, R Shiny is very easy to learn despite how powerful the tool is. If you're working on a side project or looking to add something to your portfolio, I highly recommend trying it out.
What is Shiny (R)? Shiny is an R package that enables building interactive web applications that can execute R code on the backend. With Shiny, you can host standalone applications on a webpage, embed interactive charts in R Markdown documents, or build dashboards.
Shiny is an R package that makes it easy to build interactive web apps straight from R. You can host standalone apps on a webpage or embed them in R Markdown documents or build dashboards. You can also extend your Shiny apps with CSS themes, htmlwidgets, and JavaScript actions.
By using paste
, you're treating the url
as a string. The function you want to use here is tagList
:
runApp( list(ui = fluidPage( uiOutput("tab") ), server = function(input, output, session){ url <- a("Google Homepage", href="https://www.google.com/") output$tab <- renderUI({ tagList("URL link:", url) }) }) )
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