添加超链接到R中的gt表groupname列
我有下表。
我希望 groupname_col (“make”)中的超链接在 gt 表中呈现为真正的超链接。我的代码似乎不起作用。
非常感谢任何建议。
library(tidyverse)
library(gt)
mtcars %>%
rownames_to_column("make") %>%
head() %>%
mutate(make = paste0("<a href = 'www.google.com'>",make, "</a>")) %>%
mutate(make = ifelse(is.na(make), "", make),
make = map(make, gt::html)) %>%
gt(groupname_col= "make",
rownames_to_stub = TRUE)
I have the following table.
I would like the hyperlink in the groupname_col ("make") to render as a true hyperlink in the gt table. My code does not seem to be working.
Any advice very much appreciated.
library(tidyverse)
library(gt)
mtcars %>%
rownames_to_column("make") %>%
head() %>%
mutate(make = paste0("<a href = 'www.google.com'>",make, "</a>")) %>%
mutate(make = ifelse(is.na(make), "", make),
make = map(make, gt::html)) %>%
gt(groupname_col= "make",
rownames_to_stub = TRUE)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论