Suppose I have an output from the cat function of R which is a URL. For example:
cat("https://en.wikipedia.org/wiki/Statistics")
# Output: https://en.wikipedia.org/wiki/Statistics
Is there any command on the cat function or any other thing so that the output https://en.wikipedia.org/wiki/Statistics becomes a clickable URL in the R console?
As you mentioned in the comments you are using RStudio. We didnt here yet why it has to be the console in R, but I assume there is a good reason to display the links within RStudio and I assume the viewer pane on the right next to the console also works for you.
If that is the case you could do the following:
library(DT) # for datatable() function
library(shiny) # for tags$a() function
data <- data.frame(link = toString(tags$a(href = paste0("http://google.de"), "google")))
datatable(data, escape = FALSE)
Very close to the console ;)
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