假设我有 R 的 cat 函数的输出,它是一个 URL。例如:
cat("https://en.wikipedia.org/wiki/Statistics")
# Output: https://en.wikipedia.org/wiki/Statistics
是否有关于 cat 函数或任何其他东西的命令,以便输出https://en.wikipedia.org/wiki/Statistics https://en.wikipedia.org/wiki/Statistics成为 R 控制台中可点击的 URL?
正如您在评论中提到的,您正在使用 RStudio。没有具体说明为什么它必须是 R 中的控制台,但我认为有充分的理由在 RStudio 中显示链接,并且我认为控制台右侧的查看器窗格也适合您。
如果是这种情况,您可以执行以下操作:
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 ;)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)